SkyBox

new SuperMap3D.SkyBox(options)

场景周围的天空盒。

仅在3D场景中使用变为2D场景,天空盒会淡出,天空盒大小不得超过Scene#maximumCubeMapSize.

Name Type Description
options Object 具有以下属性的对象:
Name Type Default Description
sources Object optional 六个立方体贴图面中每个面的源URL或图像对象 具体参考下面的示例。
show Boolean true optional 是否显示。
Example:
scene.skyBox = new SuperMap3D.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

horizontalRotationAngle : Number

获取或者设置天空盒子独立水平旋转角度(取值为弧度)。
Default Value: 0

show : Boolean

是否显示天空盒。
Default Value: true

sources : Object

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.
Default Value: undefined

USpeed : Number

获取或者设置天空盒子绕x轴运动的动画速度。设置为1时表示0.01弧度每秒,下同。
Default Value: 0.0

VSpeed : Number

获取或者设置天空盒子绕y轴运动的动画速度。
Default Value: 0.0

WSpeed : Number

获取或者设置天空盒子绕z轴运动的动画速度。
Default Value: 0.0

Methods

destroy()undefined

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.
Returns:
Throws:
  • DeveloperError : This object was destroyed, i.e., destroy() was called.
Example:
skyBox = skyBox && skyBox.destroy();
See:

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.
Returns:
true if this object was destroyed; otherwise, false.
See:

update()

Called when Viewer or Widget 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.