Sometimes it is useful to define a static mesh programmatically. To turn such meshes into an actual
vertex-array, you can use a
mesh-loader, or the
mesh-loader can convert from of the following types:
Packs the (legacy) vertex mesh structure into a single vertex buffer and index buffer, and then puts them together into a vertex-array.
Converts the data directly using
Converts the primitive to a
convex-meshand then translates that into a vertex-array.
Loads via the
Static meshes like these are mostly used for very simple meshes that can be constructed using the geometry construction functions that trial ships:
The functions should be self-explanatory in what they construct. All of them also take a
:mesh argument so that you can combine multiple meshes together, and
:z arguments to shift the constructed shape around.
Trial also provides a couple of assets that are generally useful from its own pool:
A centred square with its edges each 1 unit away from zero on X/Y. Ideal for rendering without any transformation matrices.
An empty vertex array, which can be useful when the vertex shader generates the vertices on its own.
A cube with a diameter of 1.
A line mesh with a coloured line along every axis.
A mesh with infinite extent to mark the zero axes in 2D.