Capítulo 21 de 859
A geometry class for a rectangular cuboid with a given width, height, and depth. On creation, the cuboid is centred on the origin, with each edge parallel to one of the axes.
const geometry = new THREE.BoxGeometry( 1, 1, 1 );
const material = new THREE.MeshBasicMaterial( { color: 0x00ff00 } );
const cube = new THREE.Mesh( geometry, material );
scene.add( cube );
Constructor
| Signature |
|---|
new BoxGeometry( width : number, height : number, depth : number, widthSegments : number, heightSegments : number, depthSegments : number ) |
Properties
| Property | Description |
|---|---|
.parameters : Object | Holds the constructor parameters that have been used to generate the geometry. Any modification after instantiation does not change the geometry. |