Page 1 of 1

Bounding box

Posted: Tue Jul 19, 2005 7:25 pm
by Nout
I've some questions:
How is the bounding box in genesis centered around an actor?
I typically will place a joint in the centre at the bottom of an actor. Is this correct, or should it be placed in the centre of the actor?

What is the real difference between a boundingbox and a dynamic boundingbox?

When making bounding boxes visible, the boxes can increase or decrease in size. Also when you have a long rectangle actor rotating, the bounding box seems not to rotate?
Is this a bug?

If you let a long thin rectangle (eg like a bar) rotate, the bounding box stays a box that is not rotating, but just tries to keep the bar fully encapsulated. Is this on purpose? and why is it the box not just rotating with the bar?

See picture included

Posted: Wed Jul 20, 2005 3:10 am
by QuestOfDreams
How is the bounding box in genesis centered around an actor?
the bounding box is the smallest axial aligned box enclosing all vertices of the actor, however IIRC the y coordinate is always larger than zero;
so when you model your actor always keep it above the x-z-plane at y=0
What is the real difference between a boundingbox and a dynamic boundingbox?
a (static) bounding box is calculated once an doesn't change it's size, a dynamic bounding box get's recalculated every time you need it, and is adapting to the current animation of an actor
When making bounding boxes visible, the boxes can increase or decrease in size.
because we're using dynamic BBs
Also when you have a long rectangle actor rotating, the bounding box seems not to rotate?
Is this a bug?
If you let a long thin rectangle (eg like a bar) rotate, the bounding box stays a box that is not rotating, but just tries to keep the bar fully encapsulated. Is this on purpose? and why is it the box not just rotating with the bar?
This is not a bug. We are using axial aligned bounding boxes (AABBs) which are defined by 2 points (max X,Y,Z and min X,Y,Z); rotating an AABB would mean rotating these 2 points, but they would still be the min and max points of an AABB - a totally different bounding box

Code: Select all

x------o max
|      |
|      |
o------x
min
rotating the box 45° would result in

min o--------o max

not

Code: Select all

      x
   /     \
 /         \
o           o            <--- not axial aligned
 \         /
   \     /
      x
You simply can't rotate an AABB that's the nature of the beast
If you need a bounding box that can be rotated you have to use an oriented bounding box (OBB) which is usually defined by 3 axis (orientation of the box) and the half length of the box in each direction

as you might guess, AABBs (2 points) are faster than OBBs (3 axis + 3 half lengths)

I once used OBBs in genesis but I can't remember exactly how I did it...

Posted: Wed Jul 20, 2005 1:17 pm
by Nout
Thanks for the explinations

For Physics, OBB's are used by Tokamak + also needed for realistic collisions
Today in RF this is not yet a big issue, as the physics use their own bounding boxes and do not collide with the AABB's of genesis, but it restricts the player, and this will be an issue for physics.

I'm not decisde yet how to handle the player because as well the physics system wants to define the players positions + collisions as also the RF system does. Both have a gravity force, both have a collision detection, bot have bounding boxes, but not identical etc...

On thing not clear yet on the AABB's
If I make an box as an actor with min(x,y,z) = (-1, 0, -1) and max(x,y,z) = (1,2,1) and I place my bone at (0, 0, 0) or I put it at (0, 1, 0) what will be the static boundingbox gensis assigns to these 2 cases?