Jump to content
  • Advertisement
Sign in to follow this  
boyfarrell

Line - bounding box internal intersection

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

Hello, I have been following the method in Graphics Gems (source code link). From what I can till this method is similar to the one described on Siggraph.org. This algorithm calculates whether or not the ray hit the bounding box (axis aligned) and also returns the point of intersection. If the origin of the ray is inside the bounding box the functions returns yes, however it doesn't calculate the intersection point! I want to be able to extent this method such that if the ray starts from inside the bounding box is will do this. Is anybody here familiar enough with this algorithm to know what to do? If you want to have a look here are some quick links to source code files (I have made a header file of RayBox and also a quick example program in the main.c): This compiles with no errors using gcc:
Quote:
gcc GraphicsGems.h RayBox.h RayBox.c main.c -o raybox
In the main file I have made a box of unit length, the ray is centered in the xy plane above the box, I have set the direction so that it comes straight down. Dan [Edited by - boyfarrell on June 4, 2008 2:14:45 PM]

Share this post


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

  • Advertisement
×

Important Information

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

We are the game development community.

Whether you are an indie, hobbyist, AAA developer, or just trying to learn, GameDev.net is the place for you to learn, share, and connect with the games industry. Learn more About Us or sign up!

Sign me up!