Graphics Programs Reference
In-Depth Information
1.4.1 Reflection
It is easy to reflect a point (
x, y, z
) about any of the three coordinate planes
xy
,
xz
,or
yz
. All that's needed is to change the sign of one of the point's coordinates. In this
section, we discuss and explain the general case where an arbitrary plane and a point
are given and we want to reflect the point about the plane. We proceed in three steps
as follows: (1) We discuss planes and their equations, (2) show how to determine the
distance of a point from a given plane, and (3) explain how to compute the reflection
of a point about a plane.
The (implicit) equation of a straight line is
Ax
+
By
+
C
=0,where
A
or
B
but not
both can be zero. The equation of a flat plane is the direct extension
Ax
+
By
+
Cz
+
D
=
0, where
A
,
B
,and
C
cannot all be zero. Four equations are needed to calculate the
four unknown coe
cients
A
,
B
,
C
,and
D
. On the other hand, we know that any three
independent (i.e., noncollinear) points
P
i
=(
x
i
,y
i
,z
i
)
,i
=1
,
2
,
3 define a plane. Thus,
we can write a set of four equations, three of which are based on three given points and
the fourth one expressing the condition that a general point (
x, y, z
) lies on the plane
xyz
1
x
1
y
1
z
1
1
0=
x
2
y
2
z
2
1
x
3
y
3
z
3
1
y
1
x
1
x
1
x
1
z
1
1
z
1
1
y
1
1
y
1
z
1
=
x
y
2
z
2
1
−
y
x
2
z
2
1
+
z
x
2
y
2
1
−
x
2
y
2
z
2
.
y
3
z
3
1
x
3
z
3
1
x
3
y
3
1
x
3
y
3
z
3
We cannot solve this system of equations because
x
,
y
,and
z
can have any values,
but we don't need to solve it! We just have to guarantee that this system has a solution.
In general, a system of linear algebraic equations has a solution if and only if its deter-
minant is zero. The expression below assumes this and also expands the determinant
by its top row:
xyz
1
x
1
y
1
z
1
1
0=
x
2
y
2
z
2
1
x
3
y
3
z
3
1
y
1
z
1
1
x
1
z
1
1
x
1
y
1
1
x
1
y
1
z
1
=
x
y
2
z
2
1
−
y
x
2
z
2
1
+
z
x
2
y
2
1
−
x
2
y
2
z
2
.
y
3
z
3
1
x
3
z
3
1
x
3
y
3
1
x
3
y
3
z
3
This is of the form
Ax
+
By
+
Cz
+
D
= 0, so we conclude that
y
1
z
1
1
x
1
z
1
1
x
1
y
1
1
x
1
y
1
z
1
A
=
y
2
z
2
1
B
=
−
x
2
z
2
1
C
=
x
2
y
2
1
D
=
−
x
2
y
2
z
2
.
y
3
z
3
1
x
3
z
3
1
x
3
y
3
1
x
3
y
3
z
3
(1.24)
Search WWH ::
Custom Search