Skip to content

ConeGeometry

Generates a cone geometry assignable to any mesh.

[ConeGeometry](/reference/geometries/cone_geometry) creates a 3D cone shape with configurable radius, height, and segment subdivisions. It is rendered using triangle primitives and can optionally exclude the bottom cap (open-ended).

cpp
auto geometry = vglx::ConeGeometry::Create({
  .radius = 0.5f,
  .height = 2.0f,
  .radial_segments = 32,
  .height_segments = 4,
  .open_ended = false
});

auto mesh = vglx::Mesh::Create(geometry, UnlitMaterial::Create(0x049EF4));
my_scene->Add(mesh);

INFO

Derives from CylinderGeometry and inherits all public properties and methods.

Construction

Constructors


ConeGeometry()

cpp
vglx::ConeGeometry::ConeGeometry(const Parameters &params)
ParameterDescription
paramsConeGeometry::Parameters

Constructs a ConeGeometry object.

Factories preferred


ConeGeometry::Create() auto

cpp
static auto vglx::ConeGeometry::Create()

Creates a shared pointer to a ConeGeometry object with default parameters.

ConeGeometry::Create() auto

cpp
static auto vglx::ConeGeometry::Create(const Parameters &params)
ParameterDescription
paramsConeGeometry::Parameters

Creates a shared pointer to a ConeGeometry object.

Types

ConeGeometry::Parameters struct

Parameters for constructing a ConeGeometry object.

NameTypeDescription
heightfloatHeight of the cone.
height_segmentsunsignedSubdivisions along the height.
open_endedboolWhether the cone is open ended.
radial_segmentsunsignedSubdivisions along the radius.
radiusfloatRadius of the cone.

Released under the MIT License.