Plane
The Plane is a flat rectangle in 3D, sized by width and height. Lay it down with rotationX for a ground surface or leave it upright for a wall or backdrop; either way its single face is flat shaded.
NOTE
For the full API, see the 3D API Reference.
Demo
Usage
ts
import {
createPlane,
} from '@ripl/3d';
const plane = createPlane({
width: 4,
height: 3,
fill: '#88cc44',
});Properties
width: width of the planeheight: height of the planex/y/z: position in world space (default0)rotationX/rotationY/rotationZ: rotation around each axis in radians (default0)scaleX/scaleY/scaleZ: scale along each axis (default1), orscalefor all threematerial: how the surface responds to light — see Materials
Type Guard
ts
import {
elementIsPlane,
} from '@ripl/3d';
if (elementIsPlane(element)) {
console.log(element.width);
}