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

    Class ScaleIndicator

    ScaleIndicator - Displays a photographic-style checkerboard scale bar

    This utility creates a visual scale reference similar to photography scale bars, helping users understand the real-world size of 3D models.

    The scale bar displays:

    • A checkerboard pattern with alternating light/dark squares
    • Clear numerical labels at intervals
    • Unit label (meters, cm, etc.)
    • Positioned on the ground plane (XZ plane)

    Features:

    • Photography-style checkerboard pattern for high visibility
    • Configurable unit labels (meters, cm, inches, etc.)
    • Customizable size, segments, and colors
    • Canvas-based text rendering for crisp labels
    const indicator = new ScaleIndicator(scene, {
    unit: 'meters',
    rulerSize: 1,
    segments: 10,
    lightColor: 0xffffff,
    darkColor: 0x000000
    });

    // Later, update or remove
    indicator.remove();
    Index

    Constructors

    Methods

    • Create a two rows checkerboard-style scale bar (like photography reference scales)

      Returns void

    • Create a flat text plane using canvas rendering (aligned to ground, not billboarded)

      Parameters

      • text: string
      • height: number

      Returns Mesh

    • Update scale bar position

      Parameters

      • x: number
      • y: number
      • z: number

      Returns void

    • Rotate the scale bar around its center

      Parameters

      • angleRadians: number

        Rotation angle in radians (around Y axis)

      Returns void

    Properties

    group: Group
    config: Required<ScaleIndicatorConfig>
    scene: Scene