# GroundPrimitiveRectangleGenerater

#### new Cesium.GroundPrimitiveRectangleGenerater(scene)
MapGIS/Scene/GroundPrimitiveRectangleGenerater.js 67

Name | Type | Description
--- | --- | ---
`scene` | Scene | 场景对象

##### Example:

    // 1. 创建一个矩形GroundPrimitive生成器
    var generater = new Cesium.GroundPrimitiveRectangleGenerater(scene);
    // 2. 创建新版场景投放对象
    var sceneProject = new Cesium.SceneProjectorEx({
        scene: viewer.scene,
        biasRatio: 10,
        heading: 0,
        pitch: Cesium.Math.toRadians(-90),
        roll: 0,
        nearClipPlane: 10,
        farClipPlane: 500,
        horizontAngle: Cesium.Math.toRadians(70),
        verticalAngle: Cesium.Math.toRadians(55)
    });
    viewer.scene.primitives.add(sceneProject);
    // 3. 获取投影帧数据
    var videoFrameData = sceneProject.projectedFrameData;
    const projectedFrameData = {
        frameData: {
            width: videoFrameData.frameData.width,
            height: videoFrameData.frameData.height,
            data: videoFrameData.frameData.data
        },
        leftTopCorner: videoFrameData.leftTopCorner,
        leftBottomCorner: videoFrameData.leftBottomCorner,
        rightTopCorner: videoFrameData.rightTopCorner,
        rightBottomCorner: videoFrameData.rightBottomCorner
    }
    // 4. 使用投影帧数据生成一个GroundPrimitive
    var groundPrimitive = generater.generateGroundPrimitive(projectedFrameData, projectedFrameData.frameData);
    // 5. 添加到场景中
    viewer.scene.primitives.add(groundPrimitive);

### Methods

#### destroy()
MapGIS/Scene/GroundPrimitiveRectangleGenerater.js 429

销毁生成的GroundPrimitive及纹理数据

#### generateGroundPrimitive(quadrangle, source) → GroundPrimitive
MapGIS/Scene/GroundPrimitiveRectangleGenerater.js 353

使用GroundPrimitive渲染一帧投影

Name | Type | Description
--- | --- | ---
`quadrangle` | Object | 投影的四边形
Name | Type | Description
--- | --- | ---
`leftTopCorner` | Cartographic |
`leftBottomCorner` | Cartographic |
`rightTopCorner` | Cartographic |
`rightBottomCorner` | Cartographic |
`source` | Object | 源数据
Name | Type | Description
--- | --- | ---
`width` | Number |
`height` | Number |
`data` | Uint8Array | HTMLImageElement |

##### Returns: