Graphics Programs Reference
In-Depth Information
62
63
64
// set the alpha based as a percent of distance ratio
// thisObj._alpha = 100 * dr;
There you have it. Save your file as 6_8_zSineMotion1.fla and test it. You should see
something similar to Figure 6.36. Piece of cake. Sweet!
Figure 6.36 Completed sinusoidal motion
Step 4: Create a different perspective
It's easy to get variations of the motion that are quite different and with very little
work. For example, let's allow the y - coordinates of the objects to move in the same
way as the z-coordinates but in the opposite direction.
36
37
38
39
40
// put it on the circle
//thisObj.x = xc + r * Math.cos(a);
thisObj.y = yc - r * Math.sin(a);
thisObj.z = zc + r * Math.sin(a);
The objects will be too high when we do this, so we will need to lower the vertical origin
yo of the screen coordinates.
 
Search WWH ::




Custom Search