Graphics Reference
In-Depth Information
Y
Y
(a)
(b)
X
ZZ
X
Fig. 5.5. (a) A left-handed system. (b) A right-handed system.
5.2 3D Coordinates
In the 2D Cartesian plane a point is located by its x -and y-coordinates .But
when we move to 3D there are two choices for positioning the third z -axis.
Figure 5.5 shows the two possibilities, which are described as left- and right-
handed axial systems. The left-handed system allows us to align our left hand
with the axes such that the thumb aligns with the x -axis, the first finger aligns
with the y -axis and the middle finger aligns with the z -axis. The right-handed
system allows the same system of alignment, but using our right hand. The
choice between these axial systems is arbitrary, but one should be aware of
the system employed by commercial computer graphics packages. The main
problem arises when projecting 3D points onto a 2D plane, which, in general,
has a left-handed axial system. This will become obvious when we look at
perspective projections. In this text we will keep to a right-handed system as
shown in Figure 5.6, which also shows a point P with its coordinates.
5.2.1 Theorem of Pythagoras in 3D
The theorem of Pythagoras in 3D is a natural extension of the 2D rule. In fact,
it even works in higher dimensions. Given two arbitrary points P 1 ( x 1 ,y 1 ,z 1 )
and P 2 ( x 2 ,y 2 ,z 2 ), the distance ∆ x = x 2
x 1 , y = y 2
y 1 and ∆ z = z 2
z 1 .
Therefore, the distance d between P 1 and P 2 is given by
d = x 2 +∆ y 2 +∆ z 2
(5.3)
5.2.2 3D Polygons
The simplest 3D polygon is a triangle, which is always planar , i.e. the three ver-
tices lie on a unique plane. Planarity is very important in computer graphics
because rendering algorithms assume that polygons are planar. For instance,
it is quite easy to define a quadrilateral in 3D where the vertices are not lo-
cated on one plane. When such a polygon is rendered and animated, spurious
highlights can result, simply because the geometric techniques (which assume
the polygon is planar) give rise to errors.
Search WWH ::




Custom Search