Skip to content

Grid

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

[Grid](/reference/nodes/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()

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

Constructs a Grid object.

Factories preferred


Grid::Create() auto

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

Creates a shared pointer to a Grid object.

Types

Grid::Parameters struct

Parameters for constructing an Grid object.

NameTypeDescription
colorColorColor of the grid.
divisionsunsignedNumber of divisions.
sizefloatSize of the grid.

Released under the MIT License.