Graphics Programs Reference
In-Depth Information
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
// Set the viewer distance d from the screen
var d:Number = 300;
// define the origin of the screen coordinate system
var xo:Number = Stage.width/2;
var yo:Number = 100;
// define the circular path characteristics
var xc:Number = -120; // xc = horiz. center of the circle
var yc:Number = -60; // yc = vert location of the circle
var zc:Number = 420; // zc = depth center of the circle
var r:Number = 450; // r = radius of circle
// define the object characteristics
var numberOfObjects:Number = 9; // number of objects to orbit
var startAngle:Number = 30.1 //30; // starting rotation angle
var target:Number = zc - r; // closest point to the viewer
// calculate the angle between any two objects on the circle
var circleAngle:Number = 360/numberOfObjects;
// create the objects for the circular motion
for (var i:Number = 0; i < numberOfObjects; i++)
{
this.createEmptyMovieClip("object"+i, i);
this["object"+i].loadMovie("j_glasses/glass"+i+".png");
}
visible. Better results for colval were obtained with the distance ratio. In fact, using
the square of the distance ratio as shown gave the results that we were after.
75
76
77
78
// to provide aerial perspective ( -255 to +255 )
colval = 100*dr*dr -140;
thisObj.myColor.setTransform({rb:colval, gb:colval,
bb:colval})
Although not done here, to make the project fully dynamic, the content could also be
loaded dynamically through a text document or XML. The more dynamic the content is,
the easier it is to update.
 
Search WWH ::




Custom Search