Graphics Reference
In-Depth Information
Units on axes. This is the measurement of distances on each of the axis.
Because all measurements in Figure 3.2 are in millimeters (mm), it is obvi-
ous that the convenient choice should be mm.
With these choices, all the interesting positions of the squares can be conveniently
identified:
Coordinate positions. All co-
ordinate positions are speci-
fied in three dimensions. This
ensures continuity as we de-
velop our knowledge into the
third dimension.
V a =(
160 mm
,
122 mm
,
0mm
)
V b =(
80 mm
,
122 mm
,
0mm
)
Large square:
,
V c =(
80 mm
,
42 mm
,
0mm
)
V d =(
160 mm
,
42 mm
,
0mm
)
=(
,
,
)
V a
160 mm
122 mm
0mm
=(
,
,
)
V e
210 mm
122 mm
0mm
Small square:
.
V f =(
210 mm
,
172 mm
,
0mm
)
V g =(
160 mm
,
172 mm
,
0mm
)
We refer to the storage associated with coordinate positions as vertices ;forexam-
Positions and vertices. In this
topic, both positions and ver-
tices are used to refer to coor-
dinate positions.
ple, V a is a vertex that stores the values of
(
160
,
122
,
0
)
. Notice that the vertices
are specified in counterclockwise order:
V a
V b
V c
V d .
As will be discussed in later chapters, the order in which we specify vertices
provides important hints to graphics hardware for optimization during image gen-
eration. In general, clockwise or counterclockwise are both acceptable. The key
is consistency: if you choose a specification ordering, it is important be consistent
throughout the application. In this topic, we will use counterclockwise ordering.
The numeric values
for the positions are results of our choice for the coor-
Choice of coordinate system.
In general, as programmers we
can perform transformations,
and thus we have the freedom
choosing any coordinate sys-
tem to define our space. As we
learn about transformations in
the later chapters of this topic,
we will re-examine the choos-
ing of coordinate systems in
more detail.
dinate system. For example, if we were to choose the origin to be located at the
center of the small square, then the numeric values for all the positions would need
to be changed accordingly. On the other hand, if we were to choose the origin to
be located at the top-right corner of the paper, then our vertex positions would
involve many negative numbers. In this case, we can see that we have chosen our
coordinate system so that it is convenient to specify locations and orientations for
our scene.
At this point, we know exactly the size and location for the squares. In real
life, we would be ready to begin drawing. As it turns out, in computer graphics
programming, it is almost just as straightforward.
Search WWH ::




Custom Search