Archived

This topic is now archived and is closed to further replies.

Fredrik Dahlberg

Möller ray/triangle-intersection-problem

Recommended Posts

Hi! I have some problem with the Möller ray/triangle intersection test. I have a triangle that''s perpendicular to the xz-plane and one of the edges lies in the xz-plane. Then I have an origin for my ray that''s in the same plane (xz-plane). Now when i shoot a ray (the ray is in xz-plane) towards the triangle it only hits for a few angles, even if it should hit for all my testcases. Can this be a problem caused by a badly choosen epsilon or can it be that I''ve choosen to use floats when I''ve implement it? /Fredrik

Share this post


Link to post
Share on other sites
grhodes_at_work    1385
Probably isn''t a float problem. Did you write your code yourself, based on Moller''s paper? Or did you take existing code from somewhere? If you used somebody else''s code, did you test it using their test cases?

Graham Rhodes
Senior Scientist
Applied Research Associates, Inc.

Share this post


Link to post
Share on other sites
Guest Anonymous Poster   
Guest Anonymous Poster
I have written the code myself. It''s an implementation of the algoritm that is described in Real-time rendering S.E. I have compared it with Möllers implementation (the one availible from www.realtimerendering.com) and it looks the same. I guess I have to run my project with his code and then maybe I found the error.
The epsilon he uses in his code is not the same as in the book which also makes me a bit confused.

/Fredrik

Share this post


Link to post
Share on other sites
grhodes_at_work    1385
Comparing against another implementation is a really good idea. I actually hate using epsilons. Any code that requires an epsilon is destined to be unreliable, though unfortunately sometimes you have to (when using floating point math).

Have you looked on the www.realtimerendering.com website? Occasionally, books have errors. In fact, there is a specific page for corrections:

http://www.ce.chalmers.se/staff/tomasm/RTR/corrigenda.html

But I don''t see any corrections related to that algorithm.

Graham Rhodes
Senior Scientist
Applied Research Associates, Inc.

Share this post


Link to post
Share on other sites