New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
THREE.Box3.setFromObject( object ) & THREE.BoundingBoxHelper( object ); #3471
Comments
Yes yes yes! Uhm, somehow |
Also prefer Fixing Issue #3370 or something must be added to the collada loader in regards to the bounding box ? After having looked at the fiddle, shouldn't the update() be happening automatically? It is part of the scene so an additional call shouldn't be required. |
In the PR, I did create I'm thinking that perhaps my original idea was better -- not having an The reason is that an object's bounding box becomes invalid after every transformation, and we can't afford to recompute it each time -- like we do for geometries in Hmmm.... |
Yup, I see what the issue... Your original idea sounds best to me now. |
OK. Backed out and reimplemented. |
Can the bounding box functions compute also actual appearance of geometries, I mean morph targets interpolations which offset vertices ? :-) |
@potomek No, the bounding box functions do not take into account morph targets. |
So I will add that but not yet, because I'm still learning of three.js |
This is a proposal for a new
Box3
methodBox3.setFromObject( object )
that computes the world-axis-aligned bounding box of an object (including its children), accounting for both the object's, and childrens', world transforms.This is different from
Geometry.computeBoundingBox()
which is not hierarchical, and does not take transforms into consideration.In addition, I propose a
BoundingBoxHelper
( different from the existingBoxHelper
as it is axis-aligned ) to show the world-axis-aligned bounding box for an object. This helper callsBox3.setFromObject( object )
.The advantages of these features should be pretty obvious. The disadvantage is that computation of the AABB of an object and it's children requires processing each vertex individually -- there are no transforms that can be applied to just the
geometry.boundingBox
to get the correct result.Feedback as to usefulness, naming, etc. is welcome. Maybe
Object3D.computeBoundingBox()
is better.Fiddle: http://jsfiddle.net/MREL4/
The text was updated successfully, but these errors were encountered: