Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 6 additions & 6 deletions docs/api/en/helpers/BoxHelper.html
Original file line number Diff line number Diff line change
Expand Up @@ -13,8 +13,8 @@
<h1>[name]</h1>

<p class="desc">
Helper object to show the world-axis-aligned bounding box around an object.

Helper object to graphically show the world-axis-aligned bounding box around an object. The actual bounding box is handled with [page:Box3], this is just a visual helper for debugging.
It can be automatically resized with the [page:BoxHelper.update] method when the object it's created from is transformed.
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].
</p>
Expand All @@ -28,10 +28,10 @@ <h2>Example</h2>


<code>
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 );
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 );
</code>


Expand Down
24 changes: 22 additions & 2 deletions docs/api/en/math/Box3.html
Original file line number Diff line number Diff line change
Expand Up @@ -12,11 +12,31 @@ <h1>[name]</h1>

<p class="desc">
Represents a box or cube in 3D space. The main purpose of this is to represent
the [link:https://en.wikipedia.org/wiki/Minimum_bounding_box Minimum Bounding Boxes]
for objects.
the world-axis-aligned bounding boxes for objects.
</p>


<h2>Example</h2>

<code>
// Creating the object whose bounding box we want to compute
var sphereObject = new THREE.Mesh(
new THREE.SphereGeometry(),
new THREE.MeshBasicMaterial( 0xff0000 )
);
// Creating the actual bounding box with Box3
sphereObject.geometry.computeBoundingBox();
var box = sphereObject.geometry.boundingBox.clone();

// ...

// In the animation loop, to keep the bounding box updated after move/rotate/scale operations
sphereObject.updateMatrixWorld( true );
box.copy( sphereObject.geometry.boundingBox ).applyMatrix4( sphereObject.matrixWorld );
</code>



<h2>Constructor</h2>


Expand Down