new Scene
The container for all 3D graphical objects and state in a Cesium virtual scene. Generally, a scene is not created directly; instead, it is implicitly created by CesiumWidget.
Parameters:
Name | Type | Argument | Default | Description |
---|---|---|---|---|
canvas |
HTMLCanvasElement | The HTML canvas element to create the scene for. | ||
contextOptions |
Object |
<optional> |
undefined | Properties corresponding to WebGLContextAttributes used to create the WebGL context. Default values are shown in the code example below. |
creditContainer |
HTMLElement |
<optional> |
undefined | The HTML element in which the credits will be displayed. |
Example
// Create scene with default context options. var scene = new Scene(canvas, { alpha : false, depth : true, stencil : false, antialias : true, premultipliedAlpha : true, preserveDrawingBuffer : false });
See:
Source:
Members
-
backgroundColor :Color
-
The background color, which is only visible if there is no sky box, i.e., Scene#skyBox is undefined.
- Default Value:
See:
-
debugCommandFilter :Function
-
This property is for debugging only; it is not for production use.
A function that determines what commands are executed. As shown in the examples below, the function receives the command's
owner
as an argument, and returns a boolean indicating if the command should be executed.The default is
undefined
, indicating that all commands are executed.Example
// Do not execute any commands. scene.debugCommandFilter = function(command) { return false; }; // Execute only the billboard's commands. That is, only draw the billboard. var billboards = new BillboardCollection(); scene.debugCommandFilter = function(command) { return command.owner === billboards; };
- Default Value:
- undefined
See:
-
farToNearRatio :Number
-
The far-to-near ratio of the multi-frustum. The default is 1,000.0.
- Default Value:
- 1000.0
-
mode :SceneMode
-
The current mode of the scene.
- Default Value:
-
morphTime :Number
-
The current morph transition time between 2D/Columbus View and 3D, with 0.0 being 2D or Columbus View and 1.0 being 3D.
- Default Value:
- 1.0
-
scene2D
-
DOC_TBA
-
skyAtmosphere :SkyAtmosphere
-
The sky atmosphere drawn around the globe.
- Default Value:
- undefined
-
skyBox :SkyBox
-
The SkyBox used to draw the stars.
- Default Value:
- undefined
See:
-
sun :Sun
-
The Sun.
- Default Value:
- undefined
Methods
-
destroy
-
DOC_TBA
-
getAnimations
-
DOC_TBA
-
getCamera
-
DOC_TBA
-
getCanvas
-
DOC_TBA
-
getContext
-
DOC_TBA
-
getFrameState
-
Gets state information about the current scene. If called outside of a primitive's
update
function, the previous frame's state is returned. -
getPrimitives
-
DOC_TBA
-
getScreenSpaceCameraController
-
DOC_TBA
-
getUniformState
-
DOC_TBA
-
initializeFrame
-
DOC_TBA
-
isDestroyed
-
DOC_TBA
-
pick
-
DOC_TBA
-
render
-
DOC_TBA