MeshTopology
Lens Studio v1.0.0+
Description
Mesh topology types used by MeshBuilder.
Enum Value | Description |
---|---|
MeshTopology.Lines |
Draws unconnected line segments. Each group of two vertices specifies a new line segment. |
MeshTopology.LineStrip |
Draws connected line segments. Starting with the second vertex, a line is drawn between each vertex and the preceding one. |
MeshTopology.Points |
Draws individual points. Each vertex specifies a new point to draw. |
MeshTopology.Triangles |
Draws unconnected triangles. Each group of three vertices specifies a new triangle. |
MeshTopology.TriangleFan |
Draws connected triangles sharing one central vertex. The first vertex is the shared one, or “hub” vertex. Starting with the third vertex, each vertex forms a triangle connecting with the previous vertex and hub vertex. |
MeshTopology.TriangleStrip |
Draws connected triangles in a strip. After the first two vertices, each vertex defines the third point on a new triangle extending from the previous one. |
Examples
// Constructs a new mesh builder
var builder = new MeshBuilder([
{ name: "position", components: 3 },
{ name: "normal", components: 3, normalized: true },
{ name: "texture0", components: 2 },
{ name: "color", components: 4 },
]);
builder.topology = MeshTopology.Triangles;
builder.indexType = MeshIndexType.UInt16;
Still Looking for help?
Visit Support