Interface SceneMeshParams

Parameters for a SceneMesh.

See @xeokit/sdk/model/scene for usage.

interface SceneMeshParams {
    bin?: string;
    color?: Vec3;
    geometryId: string;
    id: string;
    materialId?: string;
    matrix?: Mat4;
    opacity?: number;
    origin?: Vec3;
    parentTransformId?: string;
    position?: Vec3;
    quaternion?: Quat;
    rotation?: Vec3;
    scale?: Vec3;
}

Properties

bin?: string

Free-form bin identifier the SceneMesh belongs to. Frozen after construction.

The scene assigns no semantics to bin on its own — it is a tag the caller stamps on a SceneMesh for downstream consumers to group by. A renderer — were it rendering this scene — is expected to honour the tag as follows:

  • Partition the visible SceneMeshes by bin value (a missing or empty bin is treated as the implicit "default" group).
  • Process the groups in an order the renderer documents. For example, a renderer may choose to draw the default group first and then any meshes tagged "overlay" after, with the depth buffer cleared between groups so the overlay group reads as "floating" on top of the rest of the scene.
  • Honour any per-bin policy the renderer documents (e.g. depth clearing, depth-test enabled / disabled, picking priority).

The tag lives on SceneMesh rather than SceneObject because renderable batching happens at mesh granularity — a SceneMesh can be drawn by a renderer without ever being assigned to a SceneObject, so this is the layer at which bin membership is meaningful. Tools that consume the scene but do not render it — model builders, exporters, format converters, structural inspectors — may use bin as a free-form classification, or ignore it. Loaders and exporters round-trip the value verbatim.

color?: Vec3

RGB base color of the new SceneMesh.

  • Default is [1,1,1].
geometryId: string
id: string

ID for the new SceneMesh, unique within the SceneModel.

materialId?: string

ID of a SceneMaterial that was created previously with SceneModel.createMaterial.

matrix?: Mat4
opacity?: number

Opacity of the new SceneMesh.

Default is 1.

origin?: Vec3

Relative-to-center (RTC) origin.

When this is given, then SceneMeshParams.matrix will be relative to this origin.

parentTransformId?: string

ID of the parent SceneTransform that was created previously with SceneModel.createTransform.

position?: Vec3

Optional local 3D translation vector.

quaternion?: Quat

Optional local 3D rotation quaternion.

rotation?: Vec3

Optional local 3D rotation as Euler angles given in degrees, for each of the X, Y and Z axis.

scale?: Vec3

Optional local 3D scale vector.