[page:LineSegments] →
[name]
Helper object to show the world-axis-aligned bounding box around an object.
Note that the object must have a [page:Geometry] or [page:BufferGeometry] for this to work,
so it won't work with [page:Sprite Sprites].
Example
[example:webgl_helpers WebGL / helpers]
[example:webgl_loader_nrrd WebGL / loader / nrrd]
[example:webgl_buffergeometry_drawcalls advanced / buffergeometry / drawcalls]
var sphere = new THREE.SphereGeometry();
var object = new THREE.Mesh( sphere, new THREE.MeshBasicMaterial( 0xff0000 ) );
var box = new THREE.BoxHelper( object, 0xffff00 );
scene.add( box );
Constructor
[name]( [page:Object3D object], [page:Color color] )
[page:Object3D object] -- the object3D to show the world-axis-aligned boundingbox.
[page:Color color] -- (optional) hexadecimal value that defines the box's color. Default is 0xffff00.
Creates a new wireframe box that bounds the passed object. Internally this uses [page:Box3.setFromObject]
to calculate the dimensions. Note that this includes any children.
Properties
See the base [page:LineSegments] class for common properties.
Methods
See the base [page:LineSegments] class for common methods.
[method:null update]( [page:Object3D object] )
Updates the helper's geometry to match the dimensions of the
of the passed object, including any children. See [page:Box3.setFromObject].
Source
[link:https://github.com/mrdoob/three.js/blob/master/src/[path].js src/[path].js]