Game Development Reference
In-Depth Information
(b) To answer both questions, we compute the signed distance by Equation (9.14) from
Section 9.5.4:
a = q n−d
−(−7.389)
≈ (.04976)(3) + (−.8677)(4) + (−.4945)(5) + 7.389
≈ 1.595
3
4
5
.04976 −.8677 −.4945
Since this value is positive, we conclude that the point is on the front side of the
plane.
(c) Let's first solve this problem by using the 2D projection method. The dominant axis
of the normal is y, and so we'll discard the y coordinates of the vertices and project
onto the xz plane. Applying notation from Listing 9.6 (but using 1-based subscripts):
u 1 = z 1 −z 3
u 2 = z 2 −z 3
u 3 = p z −z 1
u 4 = p z −z 3
= −2−0
= 17−0
= 17.11−(−2)
= 17.11−0
= −2
= 17
= 19.11
= 17.11
v 1 = x 1 −x 3
v 2 = x 2 −x 3
v 3 = p x −x 1
v 4 = p x −x 3
= 6−(−9)
= 3−(−9)
= 13.60−6
= 13.60−(−9)
= 15
= 12
= 7.60
= 22.60
denom
= v 1 u 2 −v 2 u 1
= (15)(17)−(12)(−2)
= 279
(b 1 )(denom)
= v 4 u 2 −v 2 u 4
= (22.60)(17)−(12)(17.11)
= 178.9
b 1
= 178.9/279
= 0.641
(b 2 )(denom)
= v 1 u 3 −v 3 u 1
= (15)(19.11)−(7.60)(−2)
= 301.85
b 2
= 301.85/279
= 1.082
b 3
= 1−b 1 −b 2
= 1−0.641−1.082
= −0.723
6
10 −2
+
3 −1
17
+
−9
8
0
(d) c Grav = v 1 + v 2 + v 3
3
=
3
(6 + 3−9)
(10−1 + 8)
(−2 + 17 + 0)
0
17
15
=
=
3
3
0
=
17/3
5
0
5.66
5
(e) First, we calculate the side lengths.
3 −1
l 1 =
−9
8
0
17
=
−12
9 −17
≈ 22.67
l 2 =
6
10 −2
−9
8
0
=
15
2 −2
≈ 15.26
l 3 =
3 −1
17
6
10 −2
=
−3 −11
19
≈ 22.16
Search WWH ::




Custom Search