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 | Context and WebGL creation properties corresponding to Context#options. |
creditContainer |
HTMLElement |
<optional> |
undefined | The HTML element in which the credits will be displayed. |
Example
// Create scene without anisotropic texture filtering var scene = new Cesium.Scene(canvas, { allowTextureFilterAnisotropic : false });
See:
Source:
Members
-
animations :AnimationCollection
-
Gets the collection of animations taking place in the scene.
-
backgroundColor :Color
-
The background color, which is only visible if there is no sky box, i.e., Scene#skyBox is undefined.
- Default Value:
See:
-
camera :Camera
-
Gets the camera.
-
canvas :Element
-
Gets the canvas element to which this scene is bound.
-
completeMorphOnUserInput :Boolean
-
Determines whether or not to instantly complete the scene transition animation on user input.
- Default Value:
- true
-
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 Cesium.BillboardCollection(); scene.debugCommandFilter = function(command) { return command.owner === billboards; };
- Default Value:
- undefined
See:
-
<readonly> debugFrustumStatistics :Object
-
This property is for debugging only; it is not for production use.
When Scene.debugShowFrustums is
true
, this contains properties with statistics about the number of command execute per frustum.totalCommands
is the total number of commands executed, ignoring overlap.commandsInFrustums
is an array with the number of times commands are executed redundantly, e.g., how many commands overlap two or three frustums.- Default Value:
- undefined
-
debugShowCommands :Boolean
-
This property is for debugging only; it is not for production use.
When
true
, commands are randomly shaded. This is useful for performance analysis to see what parts of a scene or model are command-dense and could benefit from batching.- Default Value:
- false
-
debugShowFramesPerSecond :Boolean
-
This property is for debugging only; it is not for production use.
Displays frames per second and time between frames.
- Default Value:
- false
-
debugShowFrustums :Boolean
-
This property is for debugging only; it is not for production use.
When
true
, commands are shaded based on the frustums they overlap. Commands in the closest frustum are tinted red, commands in the next closest are green, and commands in the farthest frustum are blue. If a command overlaps more than one frustum, the color components are combined, e.g., a command overlapping the first two frustums is tinted yellow.- Default Value:
- false
-
drawingBufferHeight :Number
-
The drawingBufferWidth of the underlying GL context.
See:
-
drawingBufferWidth :Number
-
The drawingBufferHeight of the underlying GL context.
See:
-
farToNearRatio :Number
-
The far-to-near ratio of the multi-frustum. The default is 1,000.0.
- Default Value:
- 1000.0
-
frameState :FrameState
-
Gets state information about the current scene. If called outside of a primitive's
update
function, the previous frame's state is returned. -
fxaa :Boolean
-
When
true
, enables Fast Approximate Anti-aliasing even when order independent translucency is unsupported.- Default Value:
- false
-
fxaaOrderIndependentTranslucency :Boolean
-
If
true
, enables Fast Aproximate Anti-aliasing only if order independent translucency is supported.- Default Value:
- true
-
globe :Globe
-
Gets or sets the depth-test ellipsoid.
-
imageryLayers :ImageryLayerCollection
-
Gets the collection of image layers that will be rendered on the globe.
-
maximumAliasedLineWidth :Number
-
The maximum aliased line width, in pixels, supported by this WebGL implementation. It will be at least one.
- glGet with
ALIASED_LINE_WIDTH_RANGE
.
See:
- glGet with
-
mode :SceneMode
-
The current mode of the scene.
- Default Value:
-
moon :Moon
-
The Moon
- Default Value:
- undefined
-
morphComplete :Event
-
The event fired at the completion of a scene transition.
- Default Value:
- Event()
-
morphStart :Event
-
The event fired at the beginning of a scene transition.
- Default Value:
- Event()
-
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
-
primitives :CompositePrimitive
-
Gets the collection of primitives.
-
scene2D
-
DOC_TBA
-
screenSpaceCameraController :ScreenSpaceCameraController
-
Gets the controller for camera input handling.
-
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
-
sunBloom :Boolean
-
Uses a bloom filter on the sun when enabled.
- Default Value:
- true
-
terrainProvider :TerrainProvider
-
The terrain provider providing surface geometry for the globe.
Methods
-
completeMorph
-
Instantly completes an active transition.
-
createTextureAtlas
-
Creates a new texture atlas.
Parameters:
Name Type Argument Default Description options.pixelFormat
PixelFormat <optional>
PixelFormat.RGBA The pixel format of the texture. options.borderWidthInPixels
Number <optional>
1 The amount of spacing between adjacent images in pixels. options.initialSize
Cartesian2 <optional>
new Cartesian2(16.0, 16.0) The initial side lengths of the texture. options.images
Array <optional>
undefined Array of Image to be added to the atlas. Same as calling addImages(images). options.image
Image <optional>
undefined Single image to be added to the atlas. Same as calling addImage(image). Returns:
TextureAtlas The new texture atlas.See:
-
destroy
-
DOC_TBA
-
drillPick
-
Returns a list of objects, each containing a `primitive` property, for all primitives at a particular window coordinate position. Other properties may also be set depending on the type of primitive. The primitives in the list are ordered by their visual order in the scene (front to back).
Parameters:
Name Type Description windowPosition
Cartesian2 Window coordinates to perform picking on. Throws:
DeveloperError : windowPosition is undefined.Returns:
Array Array of objects, each containing 1 picked primitives.Example
var pickedObjects = Cesium.Scene.drillPick(new Cesium.Cartesian2(100.0, 200.0));
-
initializeFrame
-
DOC_TBA
-
isDestroyed
-
DOC_TBA
-
morphTo2D
-
Asynchronously transitions the scene to 2D.
Parameters:
Name Type Argument Default Description duration
Number <optional>
2000 The amount of time, in milliseconds, for transition animations to complete. -
morphTo3D
-
Asynchronously transitions the scene to 3D.
Parameters:
Name Type Argument Default Description duration
Number <optional>
2000 The amount of time, in milliseconds, for transition animations to complete. -
morphToColumbusView
-
Asynchronously transitions the scene to Columbus View.
Parameters:
Name Type Argument Default Description duration
Number <optional>
2000 The amount of time, in milliseconds, for transition animations to complete. -
pick
-
Returns an object with a `primitive` property that contains the first (top) primitive in the scene at a particular window coordinate or undefined if nothing is at the location. Other properties may potentially be set depending on the type of primitive.
Parameters:
Name Type Description windowPosition
Cartesian2 Window coordinates to perform picking on. Throws:
DeveloperError : windowPosition is undefined.Returns:
Object Object containing the picked primitive. -
render
-
DOC_TBA