Graphics Programs Reference
In-Depth Information
You may be wondering whether it's possible to control the tilt of the path. The answer
is that you can. The expressions
thisObj.x = xc + r * Math.cos(a);
thisObj.y = yc + r * Math.cos(a);
essentially determine the center point and radius of the circular path in the x- and y-
directions. When the radius is the same for both, they contribute equally, and the tilt is
at a 45-degree angle as Figure 6.29 shows. If the radius were 0 for the y-component,
the result would be a horizontal circular path as in Figure 6.23. If the radius were 0 for
the x-component, the result would be a vertical circular path as in Figure 6.28.
To alter the tilt, then, all we have to do is provide different radius sizes for the x- and
y-directions. For example, the expressions
thisObj.x = xc + r * Math.cos(a);
thisObj.y = yc + r * Math.cos(a)/4;
produce the results shown in Figure 6.30. In this example, xzRotation3b.fla , the
vertical contribution to the path is only one-fourth of the horizontal contribution. The
effect here is quite similar in 3D to what we saw with ellipsor.fla in 2D.
Figure 6.30 Tilted circular rotation with horizontal emphasis
Search WWH ::




Custom Search