🔒 Locked
OBB tutorials?
Advertisement
Original Post
Hi,
I was wondering if anyone here has found any tutorials for using Oriented Bounding Boxes. I did find one tutorial at Gamasutra but it was more for AABBs.
Also, is it very smart to use an OBB, as compared to using AABB? Any thoughts on the subject are welcome (or any thoughts on collision detection as well).
quote:
Original post by Moe
Just another quick question: You say that OBBs are more computationally expensive to test for the actual collision, but isn''t an AABB similarily expensive because you have to re-calculate the bounding box every time the object in it moves?
You don''t have to recalculate the AABB when the object in it moves. Only when the object rotates. You could however create an AABB for an object that would fit it in every posible orientation. However, the box would not be a very tight fit anymore. That''s what I meant with that second post.
What about cylinders? Using an "AACyl" would work well for player models. An "OCyl"would work well for things like missles. And spheres work well for things like bullets.
Using axis-aligned cylinders is indeed a nice idea. It''s pretty easy to check them against other axis-aligned bounding volumes.
But oriented cylinders?! Madness! Oriented capsules could be good, but believe me, oriented cylinders are a pain in the rear.
NOTE: a capsule is a cylinder with two halfsphere endcaps. Therefore checking intersection with a capsule is simply comparing the distance to the capsule''s linesegment to the capsule''s radius.
But oriented cylinders?! Madness! Oriented capsules could be good, but believe me, oriented cylinders are a pain in the rear.
NOTE: a capsule is a cylinder with two halfsphere endcaps. Therefore checking intersection with a capsule is simply comparing the distance to the capsule''s linesegment to the capsule''s radius.
I think for real implementation you are best off with multiple implementations.
Eg. first check for bounding spheres. When those are colliding then chec OBBs for intersection, and then for individual polygons.
For complex geometry its best to use several tight-fitting OBBs, for example if you have character models, you would build OBBs around body, head, and limbs. Plus you might wanna organize them hierarchically.
One method of testing two OBBs for intersection is given here
ftp://ftp.cs.unc.edu/pub/users/manocha/PAPERS/COLLISION/sig96.pdf
Chaper 5 "Fast overlap test for OBBs"
The easiest and most inefficient method goes like this:
for each face of the first box test intersection with each edge of the second box (totals 6x12 = 72 tests)
Do the same with boxes swapped, which makes grand total of 2x72 = 144 intersection tests.
Edit: And as Wolf said, calculating AABBs each frame is pretty fast, because you only need to check 8 vertices, those of OBBs
And link on Gamasutra provided by Scarab0 describes the same method as in the paper above.
Edited by - no way on October 17, 2001 12:02:25 AM
Eg. first check for bounding spheres. When those are colliding then chec OBBs for intersection, and then for individual polygons.
For complex geometry its best to use several tight-fitting OBBs, for example if you have character models, you would build OBBs around body, head, and limbs. Plus you might wanna organize them hierarchically.
One method of testing two OBBs for intersection is given here
ftp://ftp.cs.unc.edu/pub/users/manocha/PAPERS/COLLISION/sig96.pdf
Chaper 5 "Fast overlap test for OBBs"
The easiest and most inefficient method goes like this:
for each face of the first box test intersection with each edge of the second box (totals 6x12 = 72 tests)
Do the same with boxes swapped, which makes grand total of 2x72 = 144 intersection tests.
Edit: And as Wolf said, calculating AABBs each frame is pretty fast, because you only need to check 8 vertices, those of OBBs
And link on Gamasutra provided by Scarab0 describes the same method as in the paper above.
Edited by - no way on October 17, 2001 12:02:25 AM
Topic Locked
This topic has been locked by a moderator. New replies are not allowed.
Sign in to reply to this topic.
Advertisement