Cuboid
The cuboid() function creates a box-shaped mesh.
cuboid(100, 50, 20) .shaded() .color("purple");
Returns the Cuboid object:
Cuboid
Example usage:
cuboid.width(2).height(1).depth(3);
field
mesh: THREE.Mesh<THREE.BoxGeometry>
The THREE.Mesh instance representing this object.
Example
cuboid.mesh.rotation.y = Math.PI / 8;
method
pos(position: Vec3): Cuboid
Set the position of the object.
param position
A vector-like object representing the position.Example
cuboid.pos([0, 2, 0]);
method
color(color: THREE.ColorRepresentation): Cuboid
Set the color of the object.
param color
A color input for this object.Example
cuboid.color("navy");
method
material(material: THREE.Material): Cuboid
Set the material of the object.
param material
A THREE.Material instance.Example
cuboid.material(new THREE.MeshStandardMaterial());
method
shaded(): Cuboid
Configures the object to use a shaded material.
Example
cuboid.shaded();
method
width(width: number): Cuboid
Sets the width of the cuboid.
param width
The new width of the cuboid.Example
cuboid.width(4);
method
height(height: number): Cuboid
Sets the height of the cuboid.
param height
The new height of the cuboid.Example
cuboid.height(2);
method
depth(depth: number): Cuboid
Sets the depth of the cuboid.
param depth
The new depth of the cuboid.Example
cuboid.depth(3);