Graphics Programs Reference
In-Depth Information
Exercise 6.7: Spiral Rotation
In this exercise, we will look at how the circular rotation in 6_5_xzRotation3_DONE.fla
can easily be expanded into a more complicated spiral rotation and how to control it.
To see an example of where we are headed, open 6_7_xzSpiralRotation_DONE.swf .
Figure 6.31 shows a sample screen shot of the file. The changes that we will make all
take place within the placeObj function and involve only a few lines of code.
Figure 6.31 Example of spiral rotation
Step 1: Getting started
Open 6_5_xzRotation3_DONE.fla. As a first step, let's create the tilted rotation just
discussed. Modify the line shown and test your movie. The path of rotation should be at
a 45-degree angle.
36
37
38
39
40
// put it on the circle
thisObj.x = xc + r * Math.cos(a);
thisObj.y = yc + r * Math.cos(a);
thisObj.z = zc + r * Math.sin(a);
 
Search WWH ::




Custom Search