Skip to main content
gamedev.net
🔒 Locked

Ray-Torus intersection

Started by zurekx 0 replies 2.9k views
Original Post
zurekx
zurekx
I'm building a ray tracer and now I'd like to be able to render a torus. Which is the best way of checking ray-torus intersection? Should I solve the (quartic) equation analytically, or use some numerical method? In that case, which?
Lord Crc
Lord Crc
Well, you could start by trying this code by Jochen Schwarze. You might need to lower the epsilon value though (found some posts that mentioned 1e-30). If you experience "black holes" in your torus, you might need to do something more advanced.

Topic Locked

This topic has been locked by a moderator. New replies are not allowed.

Sign in to reply to this topic.