Creates a new MeshBuilder with the specified vertex layout.
Layout is given as a list of "attribute" objects with the following properties:
name - Attribute name components - Size of the attribute (how many float values it uses) normalized (optional) - Optional property declaring that the attribute should be normalized
var builder = new MeshBuilder([
// vertex position (x,y,z)
{ name: "position", components: 3 },
// normal vector (x,y,z)
{ name: "normal", components: 3, normalized: true },
// texture UV (u,v)
{ name: "texture0", components: 2 },
]);
The index data type used by this MeshBuilder. MeshIndexType.UInt16
is the value normally used for this.
The topology type used for the mesh.
Returns a RenderMesh asset that can be applied to a MeshVisual's mesh
property. This asset stays linked to the MeshBuilder that provided it, so making changes to the mesh data and calling updateMesh()
will update the RenderMesh as well.
A class for generating meshes at runtime.
Example
Quad Mesh Example
Cube Mesh Example