Graphics Reference
In-Depth Information
The three face normals ( u 0 , u 1 , u 2 ) from the AABB are trivially tested by computing
the AABB of the triangle and testing B and the AABB of the triangle for overlap. If
the two AABBs do not intersect, neither do B and T . Testing the axis parallel to the
triangle face normal corresponds to testing if the AABB intersects the plane of the
triangle. As this test was described in Section 5.2.3, it is not further elaborated on
here. Remaining is testing the nine axes corresponding to the cross products of the
three edge directions from B and the three edge directions from T .
As with most separating-axis tests, the computations are simplified by moving one
object (the symmetrical one, if present) to the origin. Here, the box center is moved
to align with the origin, resulting in the following variable updates: V 0
V 0
C ,
V 1
V 1
C , V 2
V 2
C , and C
(0, 0, 0). Let the triangle edges be given by f 0 =
( f 2 x , f 2 y , f 2 z ).
The nine axes considered as separating axes can then be specified as a ij
V 1
V 0
=
( f 0 x , f 0 y , f 0 z ), f 1
=
V 2
V 1
=
( f 1 x , f 1 y , f 1 z ), and f 2
=
V 0
V 2
=
=
u i
×
f j .
Because u 0 , u 1 , and u 2 have a simple form, these axes simplify as follows:
a 00
=
u 0
×
f 0
=
(1,0,0)
×
f 0
=
(0,
f 0 z , f 0 y )
a 01
=
u 0
×
f 1
=
(1,0,0)
×
f 1
=
(0,
f 1 z , f 1 y )
a 02
=
u 0
×
f 2
=
(1,0,0)
×
f 2
=
(0,
f 2 z , f 2 y )
a 10
=
u 1
×
f 0
=
(0,1,0)
×
f 0
=
( f 0 z ,0,
f 0 x )
a 11
=
u 1
×
f 1
=
(0,1,0)
×
f 1
=
( f 1 z ,0,
f 1 x )
=
×
=
×
=
a 12
u 1
f 2
(0,1,0)
f 2
( f 2 z ,0,
f 2 x )
=
×
=
×
=
a 20
u 2
f 0
(0,0,1)
f 0
(
f 0 y , f 0 x ,0)
a 21
=
u 2
×
f 1
=
(0,0,1)
×
f 1
=
(
f 1 y , f 1 x ,0)
a 22
=
u 2 ×
f 2
=
(0,0,1)
×
f 2
=
(
f 2 y , f 2 x ,0)
Recall that the projection radius of a box with respect to an axis n is given by
r
=
e 0
|
u 0
·
n
| +
e 1
|
u 1
·
n
| +
e 2
|
u 2
·
n
|
.
In the case of n
=
a 00 , this simplifies to
|
| +
|
| +
|
|
r
=
e 0
u 0
·
a 00
e 1
u 1
·
a 00
e 2
u 2
·
a 00
e 2 a 00 y
|
| +
|
| +
r
=
e 0
0
e 1
a 00 z
e 1 f 0 z +
e 2 f 0 y .
r
=
Similarly, simple expressions for the AABB projection radius are easily obtained for
the remaining a ij axes. In all cases, the projection interval of the box is simply [
r , r ].
Search WWH ::




Custom Search