Talk:Möller–Trumbore intersection algorithm
It is of interest to the following WikiProjects:
WikiProject icon | Computer science | ||||||||||
|
The pseudocode section is pretty bad. If you need to pass objects by reference in your code and use preprocessor macros, it's not pseudocode and it's not useful for describing the algorithm to a general audience. — Preceding unsigned comment added by 108.20.56.242 (talk) 16:24, 25 March 2017 (UTC) [reply ]
@MaxS 33:: I'm not sure I understand your changes to the pseudo code. A feature of the Möller-Trumbore algorithm is that it returns the barycentric coordinates of the intersection on the triangle. But after your changes to it, it doesn't do that anymore. ImTheIP (talk) 09:50, 17 September 2017 (UTC) [reply ]
@ImTheIP:: I put the intersection point calculation back. I previously took it out just to play it safe because I am using the Lighthouse3D implementation as a reference and didn't want to see complaints about deviating too much from the reference implementation. The Lighthouse3D version mentions t in a comment, but only returns true or false. I tested this implementation, including the intersection point calculation, as part of a bigger ray casting program. MaxS_33
I see. I think that our example code should stay as true to the original implementation given in the paper as possible. We can list alternatives that we find too, preferably from published sources. ImTheIP (talk) 22:01, 17 September 2017 (UTC) [reply ]
IMHO, the algorithm from the paper (and also the one that is presented in the C++ code section) is incorrect: the variable $\texttt{det}$ is compared with the absolute constant $\texttt{EPSILON},ドル but it should rather be compared against $\texttt{EPSILON}$ times the area of the triangle. Otherwise this will return "ray is parallel to plane of the triangle" for all triangles with small area. Henrik Schumacher (talk) 08:28, 18 August 2025 (UTC) [reply ]