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
Name | Type | Default | Description |
mode | DrawStyle | How to draw the plane. | |
x | number | 0 | The x coordinate of the center of the plane. |
y | number | 0 | The y coordinate of the center of the plane. |
z | number | 0 | The z coordinate of the center of the plane. |
width | number | 1 | The width of the plane, in meters. |
height | number | 1 | The height of the plane, in meters. |
angle | number | 0 | The number of radians to rotate around the rotation axis. |
ax | number | 0 | The x component of the rotation axis. |
ay | number | 1 | The y component of the rotation axis. |
az | number | 0 | The z component of the rotation axis. |
u | number | 0.0 | The u coordinate of the texture. |
v | number | 0.0 | The v coordinate of the texture. |
w | number | 1.0 - u | The width of the texture UVs to render. |
h | number | 1.0 - v | The 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
Name | Type | Default | Description |
material | Material | The material to apply to the plane. | |
x | number | 0 | The x coordinate of the center of the plane. |
y | number | 0 | The y coordinate of the center of the plane. |
z | number | 0 | The z coordinate of the center of the plane. |
width | number | 1 | The width of the plane, in meters. |
height | number | 1 | The height of the plane, in meters. |
angle | number | 0 | The number of radians to rotate around the rotation axis. |
ax | number | 0 | The x component of the rotation axis. |
ay | number | 1 | The y component of the rotation axis. |
az | number | 0 | The z component of the rotation axis. |
u | number | 0.0 | The u coordinate of the texture. |
v | number | 0.0 | The v coordinate of the texture. |
w | number | 1.0 - u | The width of the texture UVs to render. |
h | number | 1.0 - v | The 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
lovr.graphics