Graphics Programs Reference
In-Depth Information
If we omit the absolute value, then the distance becomes a signed quantity. We can
think of the plane as if it divides all of space into two parts, one in the direction of
N
and the other on the other side of the plane. The distance is positive if
P
is located in
that part of space pointed to by the normal (which is the case in Figure 1.21), and it is
negative in the opposite case.
Exercise 1.40:
What's the distance of a plane from the origin?
Now that we can figure out the distance between a point and a plane, the last
step is to reflect a point about a given plane.
We start with a point
P
=(
x, y, z
)
and a plan
e
Ax
+
By
+
C
z
+
D
= 0.
We denote the normal unit vector by
N
=
(
A, B, C
)
/
√
A
2
+
B
2
+
C
2
and the (signed) distance between
P
and the plane by
d
.To
get from
P
totheplane,wehavetotraveladistance
d
in the direction of
N
. To arrive
at the reflection point
P
∗
, we should travel another
d
units in the same direction. Thus,
the reflection
P
∗
of
P
is given by
2(
Ax
+
By
+
Cz
+
D
)
A
2
+
B
2
+
C
2
P
∗
=
P
−
2
d
N
=
P
−
(
A, B, C
)
.
(1.28)
Exercise 1.41:
Why
P
−
2
d
N
and not
P
+2
d
N
?
Most neurotics have been mindful of their five W's since grammar school: why, why,
why, why, why.
—Terri Guillemets
y
y
(1,1,1)
(0,1,2)
(1,1,1)
z
(
−
1,0,2)
x
x
(
−
1,
−
1,1)
(a)
(b)
Figure 1.22: Reflection in Three Dimensions: Examples.
Examples
. We select (Figure 1.22a) the plane
x
+
y
=0andthepoint
P
=(1
,
1
,
1).
Equation (1.28) becomes
2(1 + 1)
1+1+0
(1
,
1
,
0) = (
P
∗
=(1
,
1
,
1)
−
−
1
,
−
1
,
1)
.
Similarly, point
P
=(0
,
1
,
2) is reflected to
2(0 + 1)
1+1+0
(1
,
1
,
0) = (
P
∗
=(0
,
1
,
2)
−
−
1
,
0
,
2)
.
Search WWH ::
Custom Search