A 3D model based on glTF, the runtime asset format for WebGL, OpenGL ES, and OpenGL.
Cesium includes support for geometry and materials, glTF animations, and glTF skinning.
In addition, individual glTF nodes are pickable with Scene#pick and animatable
with Model#getNode glTF cameras and lights are not currently supported.
An external glTF asset is created with Model glTF JSON can also be
created at runtime and passed to this constructor function. In either case, the
Model#readyPromise is resolved when the model is ready to render, i.e.,
when the external binary, image, and shader files are downloaded and the WebGL
resources are created.
For high-precision rendering, Cesium supports the CESIUM_RTC extension, which introduces the
CESIUM_RTC_MODELVIEW parameter semantic that says the node is in WGS84 coordinates translated
relative to a local origin.
alias Model
- The options object takes the following properties
- {Object|ArrayBuffer|Uint8Array} [options.gltf] The object for the glTF JSON or an arraybuffer of Binary glTF defined by the KHR_binary_glTF extension.
- {String} [options.basePath= ] The base path that paths in the glTF JSON are relative to.
- {Boolean} [options.show=true] Determines if the model primitive will be shown.
- {Matrix4} [options.modelMatrix=Matrix4.IDENTITY] The 4x4 transformation matrix that transforms the model from model to world coordinates.
- {Number} [options.scale=1.0] A uniform scale applied to this model.
- {Number} [options.minimumPixelSize=0.0] The approximate minimum pixel size of the model regardless of zoom.
- {Number} [options.maximumScale] The maximum scale size of a model. An upper limit for minimumPixelSize.
- {Object} [options.id] A user-defined object to return when the model is picked with Scene#pick
- {Boolean} [options.allowPicking=true] When true, each glTF mesh and primitive is pickable with Scene#pick
- {Boolean} [options.incrementallyLoadTextures=true] Determine if textures may continue to stream in after the model is loaded.
- {Boolean} [options.asynchronous=true] Determines if model WebGL resource creation will be spread out over several frames or block until completion once all glTF files are loaded.
- {Boolean} [options.debugShowBoundingVolume=false] For debugging only. Draws the bounding sphere for each draw command in the model.
- {Boolean} [options.debugWireframe=false] For debugging only. Draws the model in wireframe.
exception {DeveloperError} bgltf is not a valid Binary glTF file.
exception {DeveloperError} Only glTF Binary version 1 is supported.
A 3D model based on glTF, the runtime asset format for WebGL, OpenGL ES, and OpenGL.
Cesium includes support for geometry and materials, glTF animations, and glTF skinning. In addition, individual glTF nodes are pickable with Scene#pick and animatable with Model#getNode glTF cameras and lights are not currently supported.
An external glTF asset is created with Model glTF JSON can also be created at runtime and passed to this constructor function. In either case, the Model#readyPromise is resolved when the model is ready to render, i.e., when the external binary, image, and shader files are downloaded and the WebGL resources are created.
For high-precision rendering, Cesium supports the CESIUM_RTC extension, which introduces the CESIUM_RTC_MODELVIEW parameter semantic that says the node is in WGS84 coordinates translated relative to a local origin.
alias Model
- The options object takes the following properties - {Object|ArrayBuffer|Uint8Array} [options.gltf] The object for the glTF JSON or an arraybuffer of Binary glTF defined by the KHR_binary_glTF extension. - {String} [options.basePath= ] The base path that paths in the glTF JSON are relative to. - {Boolean} [options.show=true] Determines if the model primitive will be shown. - {Matrix4} [options.modelMatrix=Matrix4.IDENTITY] The 4x4 transformation matrix that transforms the model from model to world coordinates. - {Number} [options.scale=1.0] A uniform scale applied to this model. - {Number} [options.minimumPixelSize=0.0] The approximate minimum pixel size of the model regardless of zoom. - {Number} [options.maximumScale] The maximum scale size of a model. An upper limit for minimumPixelSize. - {Object} [options.id] A user-defined object to return when the model is picked with Scene#pick - {Boolean} [options.allowPicking=true] When
true
, each glTF mesh and primitive is pickable with Scene#pick - {Boolean} [options.incrementallyLoadTextures=true] Determine if textures may continue to stream in after the model is loaded. - {Boolean} [options.asynchronous=true] Determines if model WebGL resource creation will be spread out over several frames or block until completion once all glTF files are loaded. - {Boolean} [options.debugShowBoundingVolume=false] For debugging only. Draws the bounding sphere for each draw command in the model. - {Boolean} [options.debugWireframe=false] For debugging only. Draws the model in wireframe.exception {DeveloperError} bgltf is not a valid Binary glTF file. exception {DeveloperError} Only glTF Binary version 1 is supported.
Model.fromGltf demo Sandcastle Models Demo