lovr.graphics.plane

Draws a plane with a given position, size, and orientation.

lovr.graphics.plane(mode, x, y, z, width, height, angle, ax, ay, az, u, v, w, h)

Arguments

NameTypeDefaultDescription
modeDrawStyleHow to draw the plane.
xnumber0The x coordinate of the center of the plane.
ynumber0The y coordinate of the center of the plane.
znumber0The z coordinate of the center of the plane.
widthnumber1The width of the plane, in meters.
heightnumber1The height of the plane, in meters.
anglenumber0The number of radians to rotate around the rotation axis.
axnumber0The x component of the rotation axis.
aynumber1The y component of the rotation axis.
aznumber0The z component of the rotation axis.
unumber0.0The u coordinate of the texture.
vnumber0.0The v coordinate of the texture.
wnumber1.0 - uThe width of the texture UVs to render.
hnumber1.0 - vThe height of the texture UVs to render.

Returns

Nothing


Draw a plane with a custom material.

lovr.graphics.plane(material, x, y, z, width, height, angle, ax, ay, az, u, v, w, h)

Arguments

NameTypeDefaultDescription
materialMaterialThe material to apply to the plane.
xnumber0The x coordinate of the center of the plane.
ynumber0The y coordinate of the center of the plane.
znumber0The z coordinate of the center of the plane.
widthnumber1The width of the plane, in meters.
heightnumber1The height of the plane, in meters.
anglenumber0The number of radians to rotate around the rotation axis.
axnumber0The x component of the rotation axis.
aynumber1The y component of the rotation axis.
aznumber0The z component of the rotation axis.
unumber0.0The u coordinate of the texture.
vnumber0.0The v coordinate of the texture.
wnumber1.0 - uThe width of the texture UVs to render.
hnumber1.0 - vThe height of the texture UVs to render.

Returns

Nothing

Notes

The u, v, w, h arguments can be used to select a subregion of the diffuse texture to apply to the plane. One efficient technique for rendering many planes with different textures is to pack all of the textures into a single image, and then use the uv arguments to select a sub-rectangle to use for each plane.

See also