SkyBox

new Cesium.SkyBox(options)

A sky box around the scene to draw stars. The sky box is defined using the True Equator Mean Equinox (TEME) axes.

This is only supported in 3D. The sky box is faded out when morphing to 2D or Columbus view. The size of the sky box must not exceed Scene#maximumCubeMapSize.

参数名称 类型 描述信息
options object Object with the following properties:
参数名称 类型 默认值 描述信息
sources object 可选 The source URL or Image object for each of the six cube map faces. See the example below.
show boolean true 可选 Determines if this primitive will be shown.
使用示例:
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'
  }
});
参考:

成员(属性)

Determines if the sky box will be shown.
默认值: true
The sources used to create the cube map faces: an object with positiveX, negativeX, positiveY, negativeY, positiveZ, and negativeZ properties. These can be either URLs or Image objects.
默认值: undefined

方法

static Cesium.SkyBox.createEarthSkyBox()SkyBox

Creates a skybox instance with the default starmap for the Earth.
返回值:
The default skybox for the Earth
使用示例:
viewer.scene.skyBox = Cesium.SkyBox.createEarthSkyBox();
Destroys the WebGL resources held by this object. Destroying an object allows for deterministic release of WebGL resources, instead of relying on the garbage collector to destroy this object.

Once an object is destroyed, it should not be used; calling any function other than isDestroyed will result in a DeveloperError exception. Therefore, assign the return value (undefined) to the object as done in the example.
Throws:
  • DeveloperError : This object was destroyed, i.e., destroy() was called.
使用示例:
skyBox = skyBox && skyBox.destroy();
参考:

isDestroyed()boolean

Returns true if this object was destroyed; otherwise, false.

If this object was destroyed, it should not be used; calling any function other than isDestroyed will result in a DeveloperError exception.
返回值:
true if this object was destroyed; otherwise, false.
参考:
Called when Viewer or CesiumWidget render the scene to get the draw commands needed to render this primitive.

Do not call this function directly. This is documented just to list the exceptions that may be propagated when the scene is rendered:

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.