Graphics Reference
In-Depth Information
We begin by moving the c term to the right-hand side:
06x
+
08y
=−
2
Notice that the right-hand side is negative, which is compensated for by multiplying the whole
equation by
1 to create
06x
08y
=
2
which now makes geometric sense. Now let's examine how the general form of the line equation
can be used to partition space.
3.5 2D space partitioning
One recurring problem in computer graphics is the need to know if a point is inside or outside
a 2D area or 3D volume. There are various solutions to this problem, but let's see how vector
analysis provides some assistance.
Equation (3.9) shows the Cartesian form of a line equation, whose graph is shown in Fig. 3.7.
Rewriting Eq. (3.9) in its general form, we get
06x
+
08y
2
=
0
(3.11)
+
When we substitute values of xy for points on the line, the expression 06x
2 equals
zero. But what happens when we substitute points that are on either side of the line? Well, let's
try substituting some points.
The point 1010 is obviously above the line, and when it is substituted in 06x
08y
+
08y
2,
we obtain the value
+
12. On the other hand, the point
10
10 is below the line, and when
substituted in 06x
16.
If we continued substituting other points, we would discover that the line partitions space
into two zones: a zone above the line where 06x
+
08y
2 produces the value
+
08y
2 is positive, and a zone below the
line where 06x
2 is negative. But the terms “above” and “below” are incorrect, as they
have no meaning for vertical lines!
To discover the key to this problem, we need to see what happens when the line's normal
vector is reversed:
+
08y
06x
08y
2
=
0
(3.12)
whose graph is shown in Fig. 3.8. Substituting 1010 in
06x
08y
2 equals
16, whereas
12. Notice that for both equations, the positive sign is in the zone containing
the normal vector, which is always the case. The reader may wish to reason why this is so.
Therefore, if we had a convex boundary formed by straight edges, how can we arrange for
their normal vectors to point outwards or inwards? This is what we'll investigate next. Ideally,
we want to create one of the scenarios shown in Fig. 3.9.
10
10 equals
+
Search WWH ::




Custom Search