Jump to content
  • Advertisement
Sign in to follow this  
thedodgeruk

obb conversion

This topic is 2900 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

at the present moment i have the center of a box and the min vect and max vect

in a book it has the code for collision detection but it needs

struct OBB
{
point c; // obb center point
vector u[3]; // local x, y, z axis
vector e ; /// positive halfwidth extents of obb along each axis
}


this is what it says in the book but i not know how to convert to it

can any one help, or point me towards a good samplde code please

Share this post


Link to post
Share on other sites
Advertisement
You already have the centre of the box and the half-width for each axis can be determined with your Min and Max vectors. The local X, Y and Z axis can be calculated based on the rotation of the object being bounded (The way you do this will depend on how you are storing the object's orientation).

Share this post


Link to post
Share on other sites
Sign in to follow this  

  • Advertisement
×

Important Information

By using GameDev.net, you agree to our community Guidelines, Terms of Use, and Privacy Policy.

Participate in the game development conversation and more when you create an account on GameDev.net!

Sign me up!