Skip to content

WireframeGeometry

Generated geometry representing the wireframe edges of a triangle mesh.

WireframeGeometry takes an existing triangle-based geometry and expands its indexed triangle list into a line list suitable for rendering with Geometry::PrimitiveType::Lines. The original vertex buffer is reused, while the index buffer is replaced with pairs of indices representing each unique edge of the mesh.

This is useful for visual debugging (visualizing topology, silhouette edges, or bounding structures) without modifying the source geometry.

cpp
auto solid = vglx::BoxGeometry::Create();
auto wireframe  = vglx::WireframeGeometry::Create(solid.get());
auto material = vglx::UnlitMaterial::Create(0xFFFFFF);

my_scene->Add(vglx::Mesh::Create(wireframe, material));

INFO

Derives from Geometry and inherits all public properties and methods.

Construction

Constructors


WireframeGeometry()

Constructs a wireframe representation of an existing geometry.

The vertex data is shared, but the index buffer is rebuilt so that each triangle contributes three line segments.

cpp
WireframeGeometry::WireframeGeometry(const Geometry* geometry);
ParameterDescription
geometryPointer to the original triangle-based geometry.

Factories preferred


WireframeGeometry::Create() std::shared_ptr<WireframeGeometry>

Creates a shared instance of WireframeGeometry.

cpp
static std::shared_ptr<WireframeGeometry> WireframeGeometry::Create(const Geometry* geometry);
ParameterDescription
geometryPointer to the original triangle-based geometry.

Released under the MIT License.