BoundingBox fit entity

Anything and everything that's related to OGRE or the wider graphics field that doesn't fit into the other forums.
1addrian111111
Gnoblar
Posts: 10
Joined: Sun Dec 14, 2014 6:50 pm

BoundingBox fit entity

Post by 1addrian111111 »

Hi,

I checked but I cant find how to create a bounding box who can rotate when my entity rotates (see the image below).
If my entity is a square the bounding box encapsulate my object. But if I rotate the object, the bounding box remains in initial position and the bounding box looks bad because toes not properly encapsulate the object.
BBox.jpg
You do not have the required permissions to view the files attached to this post.
User avatar
dark_sylinc
OGRE Team Member
OGRE Team Member
Posts: 5561
Joined: Sat Jul 21, 2007 4:55 pm
Location: Buenos Aires, Argentina
x 1403

Re: BoundingBox fit entity

Post by dark_sylinc »

The keywords you're looking for is "Object-Oriented-Bounding-Box" (OOBB, or just Oriented Bounding Box aka OBB) as opposed to "Axis-Aligned-Bounding-Box" (AABB).

Creating an OBB out of an AABB is rather easy; since it's just affine-applying the world matrix to the 8 points of the OBB, like any cube.

But if you're looking a way to calculate an OBB out of an arbitrary set of points, that is considered a hard problem and you may want to look into ApproxMVBB.