Advertisement Jump to content
Sign in to follow this  

Line - bounding box internal intersection

This topic is 3882 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 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:
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
Sign in to follow this  

  • Advertisement

Important Information

By using, you agree to our community Guidelines, Terms of Use, and Privacy Policy. 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!