ThreePresenter API Documentation - v0.1.3
    Preparing search index...

    Interface ModelDefinition

    Describes a single 3D model in the scene.

    This is a configuration object. It defines how a model should be loaded and initialized. Once loaded, the actual runtime object is stored in ThreePresenter.models as a THREE.Object3D.

    interface ModelDefinition {
        id: string;
        file: string;
        title?: string;
        position?: [number, number, number];
        rotation?: [number, number, number];
        rotationUnits?: "deg" | "rad";
        origin?: "model_coord" | "model_center";
        showBoundingBox?: boolean;
        boundingBoxColor?: string | number;
        scale?: number | [number, number, number];
        visible?: boolean;
        material?: MaterialProperties | Material & { isMaterial?: true };
    }
    Index

    Properties

    id: string

    Unique identifier for the model

    file: string

    Filename of the model (e.g., "model.glb", "mesh.ply")

    title?: string

    Human-friendly title for the model (defaults to filename base)

    position?: [number, number, number]

    Position in 3D space [x, y, z], defaults to [0, 0, 0]

    rotation?: [number, number, number]

    Rotation in radians [x, y, z], defaults to [0, 0, 0]

    rotationUnits?: "deg" | "rad"

    Optional explicit rotation units for this model. If provided, overrides scene-level setting.

    origin?: "model_coord" | "model_center"

    Controls how the model's local origin is treated before placing it in the scene.

    • 'model_coord' (default): no adjustment; the model is placed using its original coordinates.
    • 'model_center': translates the model so that its bounding-box centre falls at the world origin before any explicit position offset is applied.
    showBoundingBox?: boolean

    When true, draws a wireframe bounding box around the model in the scene.

    boundingBoxColor?: string | number

    Color of the bounding box wireframe. Accepts a hex number (0xff0000) or CSS hex string ('#ff0000'). Defaults to 0xffff00.

    scale?: number | [number, number, number]

    Scale factors [x, y, z], defaults to [1, 1, 1]

    visible?: boolean

    Whether the model is visible, defaults to true

    material?: MaterialProperties | Material & { isMaterial?: true }

    Optional material property overrides or a runtime THREE.Material instance

    • As properties (serializable): use color (hex string), metalness, roughness, flatShading.
    • As runtime material instance: provide a THREE.Material that will be set on the loaded mesh(es).