The scene module stores 3D model content: geometry, textures, materials,
meshes, objects and transforms. It does not render by itself. Rendering is done
by attaching a Viewer and renderer such as
WebGLRenderer.
A Scene has a CoordinateSystem. Each SceneModel can also
define one. This lets one Scene contain models whose source data uses different
bases, units or origins.
Scene and SceneModel transforms use double-precision arrays on the CPU. Geometry
vertex arrays are single-precision. The WebGL renderer handles large world
coordinates with camera-relative matrices and tiled batches.
Creating a SceneModel
import { Scene } from"@xeokit/sdk/model/scene"; import { TrianglesPrimitive } from"@xeokit/sdk/base/constants";
Scene Graph
📄 Cheatsheet — model/scene at a glance
The scene module stores 3D model content: geometry, textures, materials, meshes, objects and transforms. It does not render by itself. Rendering is done by attaching a Viewer and renderer such as WebGLRenderer.
A Scene owns one or more SceneModels. A SceneModel contains shared resources (geometries, materials, textures) and instances (meshes, objects, transforms).
Structure
Main types:
Coordinate Systems
A Scene has a CoordinateSystem. Each SceneModel can also define one. This lets one Scene contain models whose source data uses different bases, units or origins.
Scene and SceneModel transforms use double-precision arrays on the CPU. Geometry vertex arrays are single-precision. The WebGL renderer handles large world coordinates with camera-relative matrices and tiled batches.
Creating a SceneModel
Components are indexed by id:
Rendering
Browser rendering is optional. A minimal setup uses a Scene, Viewer, WebGLRenderer, View and ViewController:
Compressed Geometry
Use compressGeometryParams when geometry has already been prepared for compact storage or faster SceneModel creation.
Dynamic Transforms
Meshes can reference SceneTransforms. Transforms can be nested and updated after creation.
Serialization
Import and Export
Format modules can load into, or export from, a SceneModel. For example, DotBIM:
Events and Lifecycle