Sign in to follow this  

Point to OBB coordinate frame

This topic is 3577 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

Heya, I'm trying to do a very simple check to see if a point is inside an OBB. I'd like to transform the point into the OBB's space and do a simple AABB collision check on it. However, I cannot seem to get the transformation into the OBB's space correct. I have the OBB's extents, rotation matrix and center point, which I'm pretty sure is enough information to do this, but I just can't figure out what I'm doing wrong. Any help would be greatly appreciated. :)

Share this post


Link to post
Share on other sites
Take your point P in world space, subtract from it the center of the OBB in world space. Multiply this resulting point by the transpose of the OBB's 3x3 world rotation matrix. Now divide (component-wise) the point by the OBB's half-extents. You should now be able to test the point's components for whether they're in [-1,+1]; if any of them are not, it's not in the OBB...

...I think :)

Share this post


Link to post
Share on other sites

This topic is 3577 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.

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

Sign in to follow this