Graphics Reference
In-Depth Information
We now substitute the positive value of in Eq. (6.20):
p
=
4 i
+
5 j
3 k
+
1110577 i
+
0577 j
0577 k
which makes the intersection point, 104 114
94.
6.10 A line intersecting a cylinder
Another primitive used in ray tracing is the cylinder. So let's consider a cylinder with radius r
and infinite length with its rotational axis aligned with the z-axis, as shown in Fig. 6.13.
Y
T
t
λ v
P
p
O
r
Q
v
X
Z
Figure 6.13.
The line equation is given by
p
=
t
+
v
(6.21)
where is a scalar and
1.
The point P x P y P is the point of intersection, and the line QP is constructed such that it
is perpendicular to the z-axis, which makes its length equal to r.
We can now state that
v
=
2
x p +
y p =
r 2
r
=
(6.22)
But from Eq. (6.21), we see that
x p =
x t +
x v
y p =
y t +
y v
and substituting these in Eq. (6.22), we obtain
x v 2
y v 2
x t +
+
y t +
=
r 2
(6.23)
 
Search WWH ::




Custom Search