Skip to content

Grid

Visual primitive representing a finite reference grid on the XZ plane.

Grid is a scene node used to display a uniform grid, typically for orientation and spatial reference in 3D scenes. It is useful during development to visualize world units and object placement.

The grid is centered at the origin and lies flat on the XZ plane. Grid lines are evenly spaced based on the provided size and division count.

cpp
auto grid = vglx::Grid::Create({
    .size = 4.0f,
    .divisions = 16,
    .color = 0x333333
});
scene->Add(grid);

INFO

Derives from Node and inherits all public properties and methods.

Construction

Constructors


Grid()

Constructs a Grid object.

cpp
Grid::Grid(const Parameters& params);
ParameterDescription
paramsGrid::Parameters

Factories preferred


Grid::Create() auto

Creates a shared pointer to a Grid object.

cpp
static auto Grid::Create(const Parameters& params);
ParameterDescription
paramsGrid::Parameters

Types

Grid::Parameters struct

Parameters for constructing an Grid object.

ParameterDescription
size floatSize of the grid.
divisions unsignedNumber of divisions.
color ColorColor of the grid.

Released under the MIT License.