Jump to content
  • Advertisement
Sign in to follow this  
hitkimi

Implementation of OBB

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

i'm in trouble with the implementation of OBB-OBB intersection test... Can anyone give me an example of it...
in fact, i just want to know the alogrithm of detecting intersection between two boxes, so, any example of this alogrithm will be appreciated..
P.S. a small C++ project will be better....smile.gif

Thanks.....

Share this post


Link to post
Share on other sites
Advertisement
Here is an example :

[source]


bool Intersect(BoundingBox object1, BoundingBox object2)
{
if(object1.max.X < object2.min.X || object1.min.X > object2.max.X)
return false;
if(object1.max.Y < object2.min.Y || object1.min.Y > object2.max.Y)
return false;
if(object1.max.Z < object2.min.Z || object1.min.Z > object2.max.Z)
return false;

return true;
}

[/source]
Edit : never mind i thought AABB but saw later you asked for OBB : )
Here is an useful link : http://www.3dkingdoms.com/weekly/weekly.php?a=21
It is with a source code. Edited by Jeffreyp

Share this post


Link to post
Share on other sites
thanks for your help...biggrin.gif

Here is an example :

[source]


bool Intersect(BoundingBox object1, BoundingBox object2)
{
if(object1.max.X < object2.min.X || object1.min.X > object2.max.X)
return false;
if(object1.max.Y < object2.min.Y || object1.min.Y > object2.max.Y)
return false;
if(object1.max.Z < object2.min.Z || object1.min.Z > object2.max.Z)
return false;

return true;
}

[/source]
Edit : never mind i thought AABB but saw later you asked for OBB : )
Here is an useful link : http://www.3dkingdom...weekly.php?a=21
It is with a source code.



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.

GameDev.net is your game development community. Create an account for your GameDev Portfolio and participate in the largest developer community in the games industry.

Sign me up!