Graphics Programs Reference
In-Depth Information
The question that needed to be answered was what the z-value should be. A little bit of
trial and error wasn't particularly fruitful in determining a ballpark number. If the depth
is too great, the image fits entirely within the Stage area with no opportunity to pan
the image with the camera. If the depth is too shallow, panning works fine, but since
this project isn't providing the user with the ability to move up and down vertically, too
much of the image would be cropped vertically. A simple answer came in the form of
of a 3D grid overlay on the street. Equal divisions of horizontal and vertical lines in the
x-z plane provided the number needed. It later proved useful as a rough guide for the
placement of people.
Figure 7.34 A grid overlayed on the street
This is a good time to take a look at the script. It starts out like most scripts, with set-
ting the location of a viewer that works with the overall scene. For example, it was
decided to shift the viewer 100 pixels to the right so that background wouldn't start out
centered on the Stage. As usual, we are creating an empty movie clip named scene3D
and centering it on the Stage (lines 13-15).
In lines 18-25, we begin adding objects to the scene. Because of their size, the three
largest graphics are loaded dynamically into empty movie clips. The village and street
are placed at the lowest depths. The archway is placed at a depth of 4 rather than 3
because a figure will be placed behind the arch.
Search WWH ::




Custom Search