Library to make an OBB or OBB tree from a mesh

Started by
4 comments, last by Infinisearch 7 years, 2 months ago

This might be the wrong forum to ask but does anyone know of a good library that will build an OBB or OBB tree out of a mesh?

Thanks in advance.

-potential energy is easily made kinetic-

Advertisement

Not a library but couldnt you do it by your own?

The thing that an OBB needs is size/position/rotation data so assuming your mesh is logically located at initial point and rotated to initial degree then the only single thing you need to do is getting into each vertex and store the least and last point in each direction X, Y, Z so you have the size.

Getting your OBB is then simply


Center = center;
Extents = size * 0.5f;
Forward = rotation * vec3.unitZ;
Up = rotation * vec3.unitY;
Right = rotation * vec3.unitX;
An entire library devoted to such a simple task does not exist. It may be a byproduct of a larger physics library, but based on your question that entails a lot of extra baggage.
It is a 30-minute exercise to write your own. It would literally take more effort to find a library, download it, fix all the compiler errors, link to it, and figure out how to use it than to just spend a few minutes making your own.
You could have written one by the time you got this reply.


L. Spiro

I restore Nintendo 64 video-game OST’s into HD! https://www.youtube.com/channel/UCCtX_wedtZ5BoyQBXEhnVZw/playlists?view=1&sort=lad&flow=grid

Finding the best orientation for an OBB (not AABB) is not simple, but someone here did intersting research:

https://www.gamedev.net/topic/668868-an-exact-algorithm-for-finding-minimum-oriented-bounding-boxes/

Depending on the platform you can choose a math library which also provides this (and basic collision detection using the bounding volumes etc). I know directxmath provides this, if you're platform is Windows

Crealysm game & engine development: http://www.crealysm.com

Looking for a passionate, disciplined and structured producer? PM me

Thanks for the tips guys.

Not a library but couldnt you do it by your own?

Its not that trivial from what I've seen. As far as the method you posted I don't think it will output a minimal OBB for an arbitrary mesh.

It is a 30-minute exercise to write your own.

Is there any particular algorithm you suggest? So I can look it up.

Finding the best orientation for an OBB (not AABB) is not simple, but someone here did intersting research:

https://www.gamedev.net/topic/668868-an-exact-algorithm-for-finding-minimum-oriented-bounding-boxes/

Thanks for that I'll take a look.

I know directxmath provides this, if you're platform is Windows

Thanks I might end up using this at least temporarily.

-potential energy is easily made kinetic-

This topic is closed to new replies.

Advertisement