Graphics Programs Reference
In-Depth Information
Figure 6.9 Circular rotation about the y-axis
Exercise 6.4: Circular Rotation About the Y-Axis
Open 6_4_xzRotation1.fla located in the Chapter 6 folder. The script is the same as
ellipsor2.fla from Chapter 5 except that the ellipse has been given fixed proportions
and the key press interactivity has been removed to focus on the motion.
Step 1: Initialize the viewing parameters
In order to move from a 2D world to a 3D world, we need to specify the distance d from
the viewer's eye to the screen along the center of vision. Recall from Chapter 1 that
the center of vision is a line from the viewer's eye perpendicular to the picture plane
which is the monitor screen. We'll set the distance to be 600 pixels. We also need to
define where we want the center of vision to intersect the screen. This will be the origin
(xo,yo) of our screen coordinate system. Replace lines 1-6 with the lines shown below.
1
2
3
4
5
6
7
// set the viewer distance d from the screen
var d:Number = 600;
// define the origin xo, yo of the screen coordinates
var xo:Number = Stage.width/2;
var yo:Number = 0;
Search WWH ::




Custom Search