Graphics Programs Reference
In-Depth Information
Note that the direction in which the normal is pointing is irrelevant for the plane
equation. Substituting (
C ) for ( A, B, C ) would also change the sign of D ,
resulting in the same equation. However, the direction of the normal is important when
a surface is to be shaded. We want the normal, in such a case, to point outside the
surface. Often, this has to be done manually since the computer has no concept of the
shape of the object in question and the meaning of the terms “inside” and “outside.”
However, in cases where a plane is defined by three points, the direction of the normal
can be specified by arranging the three points (in the data structure in memory) in a
certain order.
It is also easy to derive the equation of a plane when three points on the plane,
P 1 , P 2 ,and P 3 , are known. In order for the points to define a plane, they should not
be collinear. We consider the vectors r = P 2
A,
B,
P 1 a local coordinate
system on the plane. Any point P on the plane can be expressed as a linear combination
P = u r + w s ,where u and w are real numbers. Since r and s are local coordinates on
the plane, the position of point P relative to the origin is expressed as (Figure 1.20b)
P 1 and s = P 3
P ( u, w )= P 1 + u r + w s ,
−∞
<u,w<
.
(1.26)
Exercise 1.39: Given the three points P 1 =(3 , 0 , 0), P 2 =(0 , 3 , 0), and P 3 =(0 , 0 , 3),
write the equation of the plane defined by them.
N
P
v
v N
Q
Figure 1.21: Distance of a Point from a Plane.
The next step is to determine the distance between a point and a plane. Given the
point P =( x, y, z ) and the plane Ax + By + Cz + D = 0, we select an arbitrary point
Q =( x 0 ,y 0 ,z 0 ) on the plane. Since Q is on the plane, it satisfies Ax 0 + By 0 + Cz 0 + D =0
or
Ax 0
By 0
Cz 0 = D . We construct the vector v from Q to P as the difference
v = P
z 0 ). Figure 1.21 shows that the required distance
(the size of the vector from the plane to P that's perpendicular to the plane) is the
component v N of v in the direction of the normal N =( A, B, C ). This component is
given by
Q =( x
x 0 ,y
y 0 ,z
v N = |
v
N
|
= |
A ( x
x 0 )+ B ( y
y 0 )+ C ( z
z 0 )
|
A 2 + B 2 + C 2
|
N
|
= |
Ax + By + Cz
Ax 0
By 0
Cz 0 |
A 2 + B 2 + C 2
= |
Ax + By + Cz + D
|
A 2 + B 2 + C 2
.
(1.27)
Search WWH ::




Custom Search