natiny.mesh.cube
Lua
natiny.mesh.cube([w [, h [, d [, subdiv]]]]) -> mesh
Builds a one-part box centred on the origin. The generated mesh has normals and
UV coordinates but no texture.
Parameters
| Name |
Type |
Default |
Description |
w |
number |
1 |
Width, the full size along X |
h |
number |
w |
Height, the full size along Y |
d |
number |
w |
Depth, the full size along Z |
subdiv |
integer |
1 |
Quads along each edge of a face; values below 1 are clamped |
Returns
| Type |
Description |
number |
Mesh handle |
Example
Lua
local cube = natiny.mesh.cube(1)
Notes
- Sizes are full extents and
subdiv is clamped to at least 1.