Skip to main content

Built-in Geometries

@luma.gl/engine exports several ready-made geometry classes. All of them extend Geometry and populate standard attributes such as POSITION, NORMAL, and TEXCOORD_0.

Overview

ClassNotes
ConeGeometryCone with optional caps.
CubeGeometryUnit cube geometry.
CylinderGeometryCylinder built on top of TruncatedConeGeometry.
IcoSphereGeometryIcosahedron-based sphere approximation.
PlaneGeometryGrid plane in x,y, x,z, or y,z.
SphereGeometryLatitude/longitude sphere.
TruncatedConeGeometryGeneralized cone or frustum primitive.

Common Pattern

import {SphereGeometry} from '@luma.gl/engine';

const geometry = new SphereGeometry({radius: 2});

Selected Constructor Props

ConeGeometry

  • radius?
  • cap?
  • Inherits radial, vertical, height, and axis options from TruncatedConeGeometry

CylinderGeometry

  • radius?
  • Inherits cap, radial, vertical, height, and axis options from TruncatedConeGeometry

TruncatedConeGeometry

  • topRadius?
  • bottomRadius?
  • topCap?
  • bottomCap?
  • height?
  • nradial?
  • nvertical?
  • verticalAxis?

PlaneGeometry

  • type?
  • xlen?, ylen?, zlen?
  • nx?, ny?, nz?
  • offset?

SphereGeometry

  • radius?
  • nlat?
  • nlong?

IcoSphereGeometry

  • iterations?

Remarks

  • These classes are convenience wrappers around typed-array geometry generation.
  • When you need to upload those attributes into GPU buffers, use them directly with Model or convert them through GPUGeometry.