Graphics Programs Reference
In-Depth Information
Step 4: Add aerial perspective
As a final step, let's add a little aerial perspective to the vases. We'll do a simple aerial
perspective here, leaving a somewhat more complicated technique for a later example.
For this exercise, we will relate the alpha of each object to its distance ratio in the same
way that the object size is determined. We just need to add the two lines shown below
to the displayObj function to get what we need.
58
59
60
61
62
63
// set the size based as a percent of distance ratio
thisObj._xscale = thisObj._yscale = 100 * dr;
// set the alpha based as a percent of distance ratio
thisObj._alpha = 100 * dr;
After inserting the lines, save your file and test your movie to make sure that the
movement and aerial perspective are working properly. Figure 6.23 shows a final
version with an additional modification of setting the viewer distance d to 500.
Tip: With objects that are created in vector graphics, it doesn't matter how big they
get scaled. In this exercise we are using bitmaps, and when we scale them larger than
Figure 6.23 Vases with aerial perspective
 
Search WWH ::




Custom Search