Graphics Programs Reference
In-Depth Information
side, we'll reduce the amplitude a little by dividing by 2 as shown. We'll also need to
adjust the vertical origin as in the last step. Use the change indicated here.
4
5
6
7
// define the origin xo, yo of the screen coordinates
var xo:Number = Stage.width/2;
var yo:Number = 40 ;
Save your movie as and test it. You should get a spiral motion shown in Figure 6.38
different than what we previously have seen. If you wish, you may fine-tune the place-
ment of the objects by trying other values such as Math.cos(a)/3 or Math.cos(a)/4 .
Figure 6.38 Sinusoidal spiral motion from Step 5
Spinning on an Axis
In the examples and exercises that we have looked at using rotation, the planar objects
have always faced us. It is natural to ask what's involved in an object spinning about its
own axis, either horizontally or vertically. A simple but not totally accurate solution can
be found by modifying the horizontal or vertical scale factors. Let's look first at a single
object, and we'll wrap up by considering multiple objects.
 
Search WWH ::




Custom Search