Skip to main content

BoxGeometry

From v4.2

Loading BoxGeometry…

A box centered at the origin. size specifies positive total X, Y and Z lengths (default [1, 1, 1]).

import {BoxGeometry} from '@math.gl/geometry/primitives';

const geometry = new BoxGeometry({size: [1.5, 1, 0.75]});

All primitives also accept id and additional attributes. Generated meshes expose POSITION, NORMAL and TEXCOORD_0 attributes, triangle-list topology, and typed indices. See Geometry for the mesh container API.