pygfx.objects.Grid
- class pygfx.objects.Grid(geometry=None, material=None, *, orientation, **kwargs)
Bases:
WorldObject
A grid to help interpret spatial distances.
The grid by default occupies 1x1 square in the xz plane. It can be scaled, rotated, and translated to move it into position. If the grid is infinite (
material.infinite
) then scale and in-plane translations are ignored.- Parameters:
geometry (Geometry) – Must be
None
. Exists for compliance with the generic WorldObject API.material (Material) – The material to use when rendering the background.
orientation (str) – The (initial) grid rotation. Must be ‘xy’ (default), ‘xz’, or ‘yz’. Simply rotates the object, e.g. for ‘xz’ will do
self.local.euler_x = np.pi/2
.kwargs (Any) – Additional kwargs are forwarded to the object’s
base class
.
Examples
Fly controller
Sphere Geometry
Camera linking 1
Line plot
Point Markers with Multiple Colors
Point Markers with Multiple Colors
Validate the grid