Skip to content

WireframeGeometry

Converts triangle-based geometry into wireframe-renderable geometry.

[WireframeGeometry](/reference/geometries/wireframe_geometry) takes an existing indexed geometry and generates a new geometry that can be rendered using GeometryPrimitiveType::Lines. It preserves the original vertex data and replaces the index buffer with one that represents the edges of the original triangle mesh.

This is commonly used for debugging purposes, such as visualizing mesh topology, bounding volumes, or silhouette edges.

cpp
auto original = vglx::BoxGeometry::Create();
auto wireframe = std::make_shared<vglx::WireframeGeometry>(original.get());
mesh->geometry = wireframe;

INFO

Derives from Geometry and inherits all public properties and methods.

Construction

Constructors


WireframeGeometry()

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

Constructs a WireframeGeometry object from an existing geometry.

Factories preferred


WireframeGeometry::Create() auto

cpp
static auto vglx::WireframeGeometry::Create(const Geometry *geometry)
ParameterDescription
geometryPointer to the original triangle-based geometry.

Creates a shared pointer to a WireframeGeometry object.

Released under the MIT License.