new SkyBox()
Sky box category. Only used in 3D scenes. When it becomes a 2D scene, the skybox will fade out, and the size of the skybox must not exceed Scene # maximumCubeMapSize.
| Name | Type | Default | Description |
|---|---|---|---|
options.sources |
Object |
optional
Please refer to the following example for the source URL or image object of each of the six cube texture faces. |
|
options.imageUrl |
String |
optional
Use a JPG or HDR format image to achieve a skybox effect. |
|
options.show |
Boolean | true |
optional
Whether to display the Sky Box. |
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'
}
});
Members
-
horizontalRotationAngleNumber
-
Get or set the independent horizontal rotation angle of the sky box (in radians).
- Default Value: 0
imageUrlString
Use a JPG or HDR format image to achieve a skybox effect.
showBoolean
Whether to display the Sky Box.
- Default Value: true
sourcesObject
Source for creating cube maps: objects with positive X, negative X, positive Y, negative Y, positive Z, and negative Z attributes.
- Default Value: undefined
USpeedNumber
Get or set the animation speed of the skybox moving around the x-axis. When set to 1, it means 0.01 radians per second, the same applies below.
- Default Value: 0.0
VSpeedNumber
Get or set the animation speed of the skybox moving around the y-axis.
- Default Value: 0.0
WSpeedNumber
Get or set the animation speed of the sky box moving around the z-axis.
- Default Value: 0.0
Methods
-
destroy(){undefined}
-
Destroy the WebGL resources held by the object. Destroying an object can release WebGL resources deterministically, rather than relying on a garbage collector to destroy the object. Once the object is destroyed, it cannot be used again; Calling any function other than isDestroyed will result in a Developer Error exception. Therefore, please assign the return value (undefined) to the object using the method shown in the example.
- See:
Throws:
-
The object has been destroyed, i.e. destroy() has been called.
- Type
- DeveloperError
Returns:
Type Description undefined Example
skyBox = skyBox && skyBox.destroy(); -
isDestroyed(){Boolean}
-
If the object has been destroyed, return true; Otherwise, return false. If the object has been destroyed, it should not be used; Calling any function other than isDestroyed will result in a Developer Error exception.
- See:
Returns:
Type Description Boolean If the object has been destroyed, it is true; Otherwise, it is false