Creates a Viewer.
Optionalparams: { id?: string; logging?: boolean; scene?: Scene }Viewer configuration.
Optionalid?: stringID for this Viewer, automatically generated by default.
Optionallogging?: booleanEnables or disables error logging to the console for this Viewer. Default value is false.
Optionalscene?: SceneContains model representations. The same Scene can be attached to any number of Viewers.
True once this Viewer has been destroyed.
Don't use this Viewer if this is false.
ReadonlyeventsThe events emitted by this Viewer.
ID of this Viewer.
Enables or disables error logging to the console for this Viewer.
Default value is false.
The number of Views belonging to this Viewer.
The Viewer's scene representation.
The !SceneModel | SceneModels is the container of !SceneModel | SceneModels and !SceneObject | SceneObjects, which contain the geometry and materials for models currently loaded in the Viewer.
Readonly InternalviewList of all the Views in this Viewer.
Each View is an independently configurable view of the Viewer's models, with its own canvas, camera position, section planes, lights, and object visual states.
ReadonlyviewsAttaches a Scene to this Viewer.
The Scene to attach.
Creates a new View within this Viewer.
const viewResult = myViewer.createView({
id: "myView",
elementId: "myView1"
});
if (!viewResult.ok) {
console.error(viewResult.error);
} else {
const view = viewResult.value;
view.camera.eye = [-3.933, 2.855, 27.018];
view.camera.look = [4.400, 3.724, 8.899];
view.camera.up = [-0.018, 0.999, 0.039];
//...
}
View configuration.
A result containing the created View on success, or an error message on failure.
Destroys this Viewer.
Detaches the currently attached Scene from this Viewer.
Gets the current configuration of this Viewer.
3D model viewer.
See "@xeokit/sdk/viewer" for usage.