natiny_mesh_plane

C
NatinyMesh natiny_mesh_plane(float w, float d, uint32_t cols, uint32_t rows);

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 Description
w float Width, the full size along X
d float Depth, the full size along Z
cols uint32_t Cells across X; clamped up to 1
rows uint32_t Cells along Z; clamped up to 1

Returns

Type Description
NatinyMesh Mesh handle

Example

C
NatinyMesh plane = natiny_mesh_plane(20.0f, 10.0f, 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.