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 ¶ms)
Parameter | Description |
---|---|
params | Grid::Parameters |
Constructs a Grid object.
Factories preferred
Grid::Create() auto
cpp
static auto vglx::Grid::Create(const Parameters ¶ms)
Parameter | Description |
---|---|
params | Grid::Parameters |
Creates a shared pointer to a Grid object.
Types
Grid::Parameters struct
Parameters for constructing an Grid object.
Name | Type | Description |
---|---|---|
color | Color | Color of the grid. |
divisions | unsigned | Number of divisions. |
size | float | Size of the grid. |