new Cesium.SkyBox(options)

环绕场景的天盒画星. 天框使用真赤道平均Equinox( TEME )轴来定义.

这只在3D中支持. 天盒在变形到2D或哥伦布视图时会淡出. 规模 the sky box must not exceed Scene#maximumCubeMapSize.

Name Type Description
options object 下列属性的对象 :
Name Type Default Description
sources object optional The source URL or Image object for each of the six cube map faces. See the example below.
show boolean true optional Determines if this primitive will be shown.
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

show : boolean

确定是否显示天框.
Default Value: true

sources : object

获取或设定原始对象.

Methods

static Cesium.SkyBox.createEarthSkyBox()SkyBox

为地球创建默认星图的天盒实例.
Returns:
地球默认天盒
Example:
viewer.scene.skyBox = Cesium.SkyBox.createEarthSkyBox();

destroy()

Destroys the WebGL resources held by this object. Destroying an object allows for deterministic 释放 WebGL 资源,而不是依赖垃圾收集器来摧毁此对象.

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.
Example:
skyBox = skyBox && skyBox.destroy();
See:

isDestroyed()boolean

如果此对象被销毁, 返回真实; 否则, 错误 .

If this object was destroyed, it should not be used; calling any function other than isDestroyed will result in a DeveloperError exception.
Returns:
true if this object was destroyed; otherwise, false.
See:

update()

Called when Viewer or CesiumWidget render the scene to 获得使这个原始化所需的绘图命令.

不要直接调用此函数 。 记录下来的只是 列出场景拍摄时可能宣传的例外情况:

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.