natiny.mesh.plane
Lua
natiny.mesh.plane([w [, d [, cols [, rows]]]]) -> mesh
Builds a one-part plane centred on the origin in the XZ plane, facing +Y.
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 |
d |
number |
w |
Depth, the full size along Z |
cols |
integer |
1 |
Cells across X; values below 1 are clamped |
rows |
integer |
1 |
Cells along Z; values below 1 are clamped |
Returns
| Type |
Description |
number |
Mesh handle |
Example
Lua
local plane = natiny.mesh.plane(20, 10, 4, 2)
Notes
- The plane lies in XZ, faces
+Y, and uses full dimensions w × d.
cols and rows are clamped to at least 1. UVs span 0..1, all normals are
(0, 1, 0), and the vertex count is 6 * cols * rows.