[page:Mesh] →

[name]

A helper object to show the world-axis-aligned bounding box for an object.

Example

var hex = 0xff0000; var sphereMaterial = new THREE.MeshLambertMaterial( {color: 0x00ff00} ); var sphere = new THREE.Mesh( new THREE.SphereGeometry( 30, 12, 12), sphereMaterial ); scene.add( sphere ); var bbox = new THREE.BoundingBoxHelper( sphere, hex ); bbox.update(); scene.add( bbox );
Note that this helper will create a wireframe [page:Mesh] object with a [page:BoxGeometry]; the resulting bounding box object will therefore have face diagonals. You may want to use [page:BoxHelper], which generates a [page:LineSegments] object without face diagonals.

Constructor

[name]( [page:Object3D object], [page:Number hex] )

[page:Object3D object] -- Object3D -- the object3D to show the world-axis-aligned boundingbox.
[page:Number hex] -- hexadecimal value that defines the box's color. Default is 0x888888.

Properties

See the base [page:Mesh] class for common properties.

[property:Object3D object]

Contains the object3D to show the world-axis-aligned boundingbox.

[property:Box3 box]

Contains the bounding box of the object.

Methods

See the base [page:LineSegments] class for common methods.

[method:null update]()

Updates the BoundingBoxHelper based on the object property.

Source

[link:https://github.com/mrdoob/three.js/blob/master/src/[path].js src/[path].js]