lovr.graphics.cylinder
Draws a cylinder.
lovr.graphics.cylinder(x, y, z, length, angle, ax, ay, az, r1, r2, capped, segments)
Arguments
Name | Type | Default | Description |
x | number | 0 | The x coordinate of the center of the cylinder. |
y | number | 0 | The y coordinate of the center of the cylinder. |
z | number | 0 | The z coordinate of the center of the cylinder. |
length | number | 1 | The length of the cylinder, in meters. |
angle | number | 0 | The rotation of the cylinder around its rotation axis, in radians. |
ax | number | 0 | The x coordinate of the cylinder's axis of rotation. |
ay | number | 1 | The y coordinate of the cylinder's axis of rotation. |
az | number | 0 | The z coordinate of the cylinder's axis of rotation. |
r1 | number | 1 | The radius of one end of the cylinder. |
r2 | number | 1 | The radius of the other end of the cylinder. |
capped | boolean | true | Whether the top and bottom should be rendered. |
segments | number | nil | The number of radial segments to use for the cylinder. If nil, the segment count is automatically determined from the radii. |
Returns
Nothing
lovr.graphics.cylinder(material, x, y, z, length, angle, ax, ay, az, r1, r2, capped, segments)
Arguments
Name | Type | Default | Description |
material | Material | The Material to apply to the cylinder. | |
x | number | 0 | The x coordinate of the center of the cylinder. |
y | number | 0 | The y coordinate of the center of the cylinder. |
z | number | 0 | The z coordinate of the center of the cylinder. |
length | number | 1 | The length of the cylinder, in meters. |
angle | number | 0 | The rotation of the cylinder around its rotation axis, in radians. |
ax | number | 0 | The x coordinate of the cylinder's axis of rotation. |
ay | number | 1 | The y coordinate of the cylinder's axis of rotation. |
az | number | 0 | The z coordinate of the cylinder's axis of rotation. |
r1 | number | 1 | The radius of one end of the cylinder. |
r2 | number | 1 | The radius of the other end of the cylinder. |
capped | boolean | true | Whether the top and bottom should be rendered. |
segments | number | nil | The number of radial segments to use for the cylinder. If nil, the segment count is automatically determined from the radii. |
Returns
Nothing
Notes
Currently, cylinders don't have UVs.
See also
lovr.graphics