BuildingPrimitive

new Cesium.BuildingPrimitive(options)

建筑对象.包括上下两个多边形面,关联数组存储Floor对象; 根据材质不同执行批次渲染墙面。上下建筑物底面一次绘制, 支持顶面和边墙的材质重设,边墙通过缓存相同材质对象打组批次绘制,效率较高。 当前对象为渲染对象,移除操作应当参考Scene移除Primitive的方式移除.。
Name Type Description
options Object 如下
Name Type Default Description
scene Scene Scene.
id * createGuid() optional id
positions Array.<Cartesian3> 底边坐标点串
minimumHeights Number 建筑物底面高程
maximumHeights Number 建筑物顶面高程
floorHeight Number 3.0 optional 每层建筑物层高
show Boolean true optional 是否可见
wallImage String | HTMLImageElement | HTMLCanvasElement | HTMLVideoElement 'buildModuleUrl('Assets/Images/cityplan/outer_wall.jpg')' optional 墙面材质
wallUseColor Boolean false optional true,墙面使用颜色填充,false墙面使用图片材质填充
wallColor Color Color.GRAY optional 墙面颜色
wallRepeat Cartesian2 new Cartesian(1,1) optional 墙面的材质排列
roofImage String | HTMLImageElement | HTMLCanvasElement | HTMLVideoElement 'buildModuleUrl('Assets/Images/cityplan/roof.jpg')' optional 房顶材质
roofUseColor Boolean false optional true,房顶面使用颜色填充,false房顶面使用图片材质填充
roofColor Color Color.GRAY optional 房顶面颜色
roofRepeat Cartesian2 new Cartesian(1,1) optional 房顶面的材质排列
Example:
viewer.scene.primitives.removeAndDestroy(buildPrimitive);

Members

房顶面颜色

roofImage : String|HTMLImageElement|HTMLCanvasElement|HTMLVideoElement

房顶面材质
房顶面的材质排列
true,房顶面使用颜色填充,false房顶面使用图片材质填充
是否显示
墙面颜色

wallImage : String|HTMLImageElement|HTMLCanvasElement|HTMLVideoElement

墙面材质
墙面的材质排列
true,墙面使用颜色填充,false墙面使用图片材质填充

Methods

getFloorByIndex(index)Floor|undefined

根据楼层索引获取楼层对象
Name Type Description
index 楼层索引 从0开始
Returns:

getSideByIndex(index)Array.<Wall>

或者指定垂直侧面上的所有{Wall}对象
Name Type Description
index 侧面索引对象,从0开始,最大为底边闭合点坐标的个数
Returns:

getWallByIndex(floorIndex, sideIndex)undefined|Wall

获取指定索引位置处的{Wall}对象
Name Type Description
floorIndex 楼层索引,
sideIndex 侧边索引
Returns:
Need help? The fastest way to get answers is from the community and team on the Cesium Forum.