The Data created by the DemoHelper. Holds all data models.
The maximum number of views to create.
Base directory for loading models, relative to the HTML page.
The WebGLRenderer created by the DemoHelper.
The Scene created by the DemoHelper. Holds all 3D objects.
Statistics about the demo, available after calling finished().
The Viewer created by the DemoHelper.
Tracks created Views by their IDs, along with their associated CameraFlightAnimation and ViewController.
Gets the SceneAABB3Index for the Scene, which dynamically tracks the 3D boundaries of the objects in the Scene.
Creates a new View in the Viewer.
When viewParams.elementId and viewParams.htmlElement are omitted,
this method auto-creates a canvas element, passes it to viewer.createView,
and lays it out snugly with other auto-created canvases inside the window.
Auto-created canvases are given z-index: 100000.
The first View created becomes the DemoHelper's primary view, and gets
a CameraFlightAnimation and ViewController.
Parameters for the View.
The created View.
Destroys a View created by createView(), removing its canvas if it was auto-created.
Finalizes the demo setup, gathering statistics and signaling completion.
Initializes the DemoHelper by creating the Scene, Data, Viewer, WebGLRenderer, and optional initial View.
Configuration options for initialization.
A promise that resolves when initialization is complete.
Loads a model into the Scene and/or Data layers using a format-specific loader.
This method:
params.src or a default path derived from modelIdparams.formatSupported formats:
"xgf" → XGFLoader (binary)"ifc" → IFCLoader (binary)"gltf" → GLTFLoader (binary, .glb)"metamodel" → MetaModelLoader (JSON, data-only)"datamodel" → DataModelParamsLoader (JSON, data-only)"scenemodel" → SceneModelParamsLoader (JSON, scene-only)Default source resolution:
If params.src is not provided, the source path is inferred as:
../../models/{modelId}/{format}/model.{ext}
Model creation behavior:
sceneModel is not provided, a new one is created via this.scene.createModel()dataModel is not provided, a new one is created via this.data.createModel()modelId when availableConfiguration for loading the model
OptionaldataModel?: DataModelOptional existing DataModel to populate
Model format determining which loader to use
OptionalmodelId?: stringOptional identifier used for default paths and generated model IDs
OptionalsceneModel?: SceneModelOptional existing SceneModel to populate
Optionalsrc?: stringOptional explicit source URL/path for the model file
Loader-specific options passed through to the underlying loader
A promise resolving to an SDKResult containing the loader result
Toggles the visibility of the floating inspector panels.
Helper class to set up a basic 3D demo with a Scene, Data, Viewer, WebGLRenderer, and View.
See @xeokit/sdk/demo for usage.