SkyBox

new Cesium.SkyBox(options)

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

仅支持 3D。当过渡到 2D 或 Columbus 视图时,天空盒会逐渐消失。 天空盒的大小不能超过 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
获取或设置图元对象。

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,并且必须具有 positiveX、negativeX、positiveY、negativeY、positiveZ 和 negativeZ 属性。
  • DeveloperError : this.sources 属性必须都是相同类型。
Need help? The fastest way to get answers is from the community and team on the Cesium Forum.