Description
The Lines
field is a member of the MeshPrimitiveType
enumeration in the Sandbox namespace. It represents a primitive type used in rendering meshes, specifically for drawing lines. When using this primitive type, each pair of vertices defines a separate line segment.
Usage
Use the Lines
field when you need to render a mesh using line segments. This is particularly useful for wireframe models or when you want to highlight edges in a 3D scene.
Example
// Example of using MeshPrimitiveType.Lines
Mesh mesh = new Mesh();
mesh.SetPrimitiveType(MeshPrimitiveType.Lines);
// Define vertices for the lines
Vector3[] vertices = new Vector3[]
{
new Vector3(0, 0, 0),
new Vector3(1, 0, 0),
new Vector3(1, 1, 0),
new Vector3(0, 1, 0)
};
// Set the vertices to the mesh
mesh.SetVertices(vertices);
// Render the mesh in the scene
Scene.Current.Add(mesh);