SkyBox

new Cesium.SkyBox(options)

场景周围的天空框用于绘制星星。 天空盒使用真赤道平均分 (TEME) 轴定义。

这仅在 3D 中受支持。 天空盒在变形为 2D 或哥伦布视图时淡出。 的大小 天空盒不得超过 Scene#maximumCubeMapSize

Name Type Description
options object 对象,具有以下属性:
Name Type Default Description
sources object optional 六个立方体贴图面中每个面的源 URL 或 Image 对象。 请参阅下面的示例。
show boolean true optional 决定是否显示此基元。
Example:
scene.skyBox = new Cesium.SkyBox({
  sources : {
    positiveX : 'skybox_px.png',
    negativeX : 'skybox_nx.png',
    positiveY : 'skybox_py.png',
    negativeY : 'skybox_ny.png',
    positiveZ : 'skybox_pz.png',
    negativeZ : 'skybox_nz.png'
  }
});
See:

Members

确定是否显示天空框。
Default Value: true
用于创建立方体贴图面的源:对象 与 positiveXnegativeXpositiveYnegativeYpositiveZnegativeZ 属性。 这些可以是 URL 或 Image 对象。
Default Value: undefined

Methods

static Cesium.SkyBox.createEarthSkyBox()SkyBox

使用地球的默认星图创建天空盒实例。
Returns:
地球的默认天空盒
Example:
viewer.scene.skyBox = Cesium.SkyBox.createEarthSkyBox();
销毁此对象持有的 WebGL 资源。 销毁对象允许确定性 释放 WebGL 资源,而不是依赖垃圾回收器来销毁这个对象。

一旦对象被销毁,就不应该使用它;调用 isDestroyed 将导致 DeveloperError 异常。 因此 将返回值 (undefined) 分配给对象,如示例中所示。
Throws:
Example:
skyBox = skyBox && skyBox.destroy();
See:

isDestroyed()boolean

如果此对象已销毁,则返回 true;否则为 false。

如果此对象已销毁,则不应使用;调用 isDestroyed 将导致 DeveloperError 异常。
Returns:
true,如果此对象被销毁;否则为 false
See:
ViewerCesiumWidget 将场景渲染到 获取渲染此基元所需的绘制命令。

请勿直接调用此函数。 这记录下来只是为了 列出渲染场景时可能传播的异常:

Throws:
  • DeveloperError : this.sources is required and must have positiveX, negativeX, positiveY, negativeY, positiveZ, and negativeZ properties.
  • DeveloperError : this.sources properties must all be the same type.
Need help? The fastest way to get answers is from the community and team on the Cesium Forum.