Graphics Programs Reference
In-Depth Information
Figure 11.21 The Glass Gallery based on the Gargoyle Gallery
folder. The number of objects has changed from six to nine. In order to make it easy
to select the larger number of items, the scene was set to be viewed slightly above the
plane of motion by setting the vertical center of the plane yc to be 60 pixels below the
vertical origin of the coordinate system in line 10. The vertical origin yo was adjusted
to comfortably display the glasses on the Stage. The radius of the path of motion
remained the same, but the depth center of the circle was brought forward to bring
the glasses closer to the viewer.
An important thing to note is the value of the startAngle . Rather than using 30
degrees as we did in the Gargoyle Gallery, the value used is 30.1. This was necessary
to force all of the glasses to have different z-coordinates initially. When 30 degrees was
used and the displayObj() function was called, two glasses had identical z-coordi-
nates which in turn caused them both to attempt to swapDepths() to the same value,
which Flash doesn't allow. The visual result was that a small glass in the back over-
lapped a larger glass in the front and was on top of it. In most situations, the problem
doesn't arise, but when it does, a little tweaking of z-values usually solves the problem.
One other change to the code is worth mentioning. The treatment of the aerial perspec-
tive is somewhat different in this example. A dramatic falloff from the spotlight was
desired while, at the same time, making sure that the glasses in the back were clearly
Search WWH ::




Custom Search