English中文

SkyBox

new Cesium.SkyBox(options)

场景周围的天空盒用于绘制星星。天空盒是使用真赤道平均春分点 (TEME) 轴定义的。 A sky box around the scene to draw stars. The sky box is defined using the True Equator Mean Equinox (TEME) axes.

仅 3D 支持此功能。转变成 2D 或哥伦布视图时,天空盒会淡出。天空盒的大小不得超过 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.

名称 Name 类型 Type 说明 Description
options object 具有以下属性的对象: Object with the following properties:
名称 Name 类型 Type 默认值 Default 说明 Description
sources object 可选 optional 源 URL 或 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

获取或设置原始对象。 Gets or sets the the primitive object.

方法 Methods

static Cesium.SkyBox.createEarthSkyBox()SkyBox

使用地球的默认星图创建一个天空盒实例。 Creates a skybox instance with the default starmap for the Earth.
返回: Returns:
地球的默认天空盒 The default skybox for the Earth
示例: Example:
viewer.scene.skyBox = Cesium.SkyBox.createEarthSkyBox();
销毁该对象持有的 WebGL 资源。销毁对象可以确定性地释放 WebGL 资源,而不是依赖垃圾收集器来销毁该对象。 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.
示例: Example:
skyBox = skyBox && skyBox.destroy();
另见: See:

isDestroyed()boolean

如果该对象被销毁则返回 true;否则为假。 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.
返回: Returns:
true 如果该物体被摧毁;否则, if this object was destroyed; otherwise, false.
另见: See:
调用时间 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.
需要帮助吗?获得答案的最快方法是从社区和团队那里获得答案 Need help? The fastest way to get answers is from the community and team on the Cesium Forum.