Graphics Programs Reference
In-Depth Information
It is important to note the relationship between
yc
and
yo
, the vertical origin of the
3D coordinate system. Our original values,
yo = 0
and
yc = -250
, were selected so
that the objects would display approximately in the center of the Stage. As the rotation
plane moves up or down, we will see that the objects begin to move off the Stage if
yo
remains constant. If we want to keep the objects generally centered on the Stage, we
must make adjustments to
yo
as
yc
is moved. Referring to Figure 6.26, we see that the
difference between
yo
and
yc
is equal to 250 in each case. Keeping the same relative
distance between
yo
and
yc
will result in the objects staying in the center of the Stage.
Horizontal Center of the Circle
Suppose you want your objects to orbit on a tilted path. One solution, of course, would
be to tilt the orbital path. However, there's another, easier solution. Changing the hori-
zontal center,
xc
, of the orbital circle either to the left or right moves it farther away
from the center of vision. This in turn will change the perspective of the orbit as shown
in Figure 6.27 with
xc
values of
xc = 300
and
xc = -300
.
Figure 6.27
Changing the horizontal center of the circular path
The farther the paths are from the horizontal center of vision
xo
, the greater the angle
of tilt when they are converted to screen coordinates. As we saw with changes in the
vertical center, changes in the horizontal center
xc
need to be accompanied by adjust-
ments to
xo
in order to display the rotating objects in the center of the Stage.
Rotation in the y-z Plane
A circular path rotation in the y-z plane is equivalent to a rotation about the x-axis or
a line parallel to the x-axis. Everything that we discussed regarding rotation about the
y-axis also holds for rotation about the x-axis. We can use the same functions
Search WWH ::
Custom Search