[Ardor3d] Exact bounding boxes
Posted by Stefan on Feb 19, 2016; 3:56pm
URL: https://forum.jogamp.org/Ardor3d-Exact-bounding-boxes-tp4036316.html
Hi,
is there a way to determine the exact bounding box of a node in Ardor3d? The provided "getWorldBounds" method does not return the expected result.
Imagine you have a sphere with radius 0.5. If you compute the axis-aligned world bounding box you get size 1 in all three dimensions.
Now, imagine you have the same sphere and rotate it around x by 45 degrees. You would expect the same bounding box but "getWorldBounds" returns a different result. It seems like there is a invisible box around the sphere which gets rotated and the bounds are computed for that box.
Is there a way to avoid this behavior? I couldn't find a solution for it.
This is the code:
BoundingVolume worldBounds = sphereNode.getWorldBound();
BoundingBox worldBoundingBox = (BoundingBox)worldBounds.asType(Type.AABB);
Regards,
Stefan