<s>
The	O
Möller	O
–	O
Trumbore	O
ray-triangle	O
intersection	B-Algorithm
algorithm	O
,	O
named	O
after	O
its	O
inventors	O
Tomas	O
Möller	O
and	O
Ben	O
Trumbore	O
,	O
is	O
a	O
fast	O
method	O
for	O
calculating	O
the	O
intersection	B-Algorithm
of	O
a	O
ray	O
and	O
a	O
triangle	O
in	O
three	O
dimensions	O
without	O
needing	O
precomputation	O
of	O
the	O
plane	O
equation	O
of	O
the	O
plane	O
containing	O
the	O
triangle	O
.	O
</s>
<s>
Among	O
other	O
uses	O
,	O
it	O
can	O
be	O
used	O
in	O
computer	O
graphics	O
to	O
implement	O
ray	B-Algorithm
tracing	I-Algorithm
computations	O
involving	O
triangle	B-Algorithm
meshes	I-Algorithm
.	O
</s>
<s>
The	O
plane	O
that	O
the	O
triangle	O
is	O
on	O
,	O
which	O
is	O
needed	O
to	O
calculate	O
the	O
ray-triangle	O
intersection	B-Algorithm
,	O
is	O
defined	O
by	O
a	O
point	O
on	O
the	O
plane	O
,	O
such	O
as	O
,	O
and	O
a	O
vector	O
that	O
is	O
orthogonal	O
to	O
every	O
point	O
on	O
that	O
plane	O
,	O
such	O
as	O
the	O
cross	O
product	O
between	O
the	O
vector	O
from	O
to	O
and	O
the	O
vector	O
from	O
to	O
:	O
</s>
<s>
First	O
,	O
find	O
out	O
if	O
the	O
ray	O
intersects	O
with	O
the	O
plane	O
that	O
the	O
triangle	O
is	O
on	O
,	O
and	O
if	O
it	O
does	O
,	O
find	O
the	O
coordinates	O
of	O
that	O
intersection	B-Algorithm
.	O
</s>
<s>
To	O
find	O
and	O
for	O
a	O
particular	O
intersection	B-Algorithm
,	O
set	O
the	O
ray	O
expression	O
equal	O
to	O
the	O
plane	O
expression	O
,	O
and	O
put	O
the	O
variables	O
on	O
one	O
side	O
and	O
the	O
constants	O
on	O
the	O
other	O
.	O
</s>
<s>
The	O
algorithm	O
can	O
use	O
Cramer	O
's	O
Rule	O
to	O
find	O
the	O
,	O
,	O
and	O
values	O
for	O
an	O
intersection	B-Algorithm
,	O
and	O
if	O
it	O
lies	O
within	O
the	O
triangle	O
,	O
the	O
exact	O
coordinates	O
of	O
the	O
intersection	B-Algorithm
can	O
be	O
found	O
by	O
plugging	O
in	O
to	O
the	O
ray	O
's	O
equation	O
.	O
</s>
<s>
The	O
following	O
is	O
an	O
implementation	O
of	O
the	O
algorithm	O
in	O
C++	B-Language
:	O
</s>
<s>
The	O
following	O
is	O
an	O
implementation	O
of	O
the	O
algorithm	O
in	O
Java	B-Language
using	O
javax.vecmath	O
from	O
Java	B-Language
3D	I-Language
API	O
:	O
</s>
