Selva Compute API Reference - v2.1.0
    Preparing search index...

    Interface GridOptions

    An "infinite", distance-fading reference grid — the single strongest visual cue that reads as CAD.

    Why not GridHelper: it's a fixed-size square of line segments that visibly ends and looks wrong once you pan or zoom past it. Instead we draw one large screen-facing plane and compute the grid in the fragment shader from world coordinates, fading lines out with distance so the edge is never a hard cutoff. The plane is big enough to cover any reasonable view; the fade hides its bounds.

    Two line frequencies (minor + major every 10th) give the usual graph-paper depth read. Spacing is in world units (meters — the scene's normalized unit), so a cellSize of 1 = 1m minor cells.

    interface GridOptions {
        cellColor?: ColorRepresentation;
        cellSize?: number;
        fadeDistance?: number;
        majorColor?: ColorRepresentation;
        majorEvery?: number;
        plane?: "x" | "y" | "z";
    }
    Index

    Properties

    Minor line color.

    cellSize?: number

    Minor cell size in world units (meters). Default 1.

    fadeDistance?: number

    World-space radius at which the grid has fully faded out. Default 100.

    majorColor?: ColorRepresentation

    Major line color.

    majorEvery?: number

    How many minor cells per major line. Default 10.

    plane?: "x" | "y" | "z"

    Plane to lay the grid on. 'y' = horizontal ground (Three Y-up). Default 'y'.