Description
The MeshPrimitiveType.Points
field is a member of the MeshPrimitiveType
enumeration in the Sandbox API. It represents a primitive type used in rendering operations where each vertex is rendered as a single point. This is useful for visualizing individual vertices without connecting them with lines or forming polygons.
Usage
Use MeshPrimitiveType.Points
when you want to render a mesh where each vertex is displayed as an isolated point. This can be particularly useful for debugging purposes or when you want to visualize the distribution of vertices in a mesh without any connecting geometry.
Example
// Example of using MeshPrimitiveType.Points
Mesh mesh = new Mesh();
mesh.PrimitiveType = MeshPrimitiveType.Points;
// Add vertices to the mesh
mesh.AddVertex(new Vector3(0, 0, 0));
mesh.AddVertex(new Vector3(1, 0, 0));
mesh.AddVertex(new Vector3(0, 1, 0));
// Render the mesh
Scene.Current.Add(mesh);