SkyBox

new Cesium.SkyBox(options)

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

仅支持 3D 模式。当切换到 2D 或 Columbus 视图时,天空盒会淡出。天空盒的大小不得超过 Scene#maximumCubeMapSize

Name Type Description
options object Object with the following properties:
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 的所有属性必须类型相同。
需要帮助?获取答案的最快方式是在 Cesium 论坛 上向社区和团队提问。