Graphics Programs Reference
In-Depth Information
Figure 7.28 Viewer rotation seen from above
Step 9: Add a few refinements
There are a few refinements that should be made for a better user experience. Our
tooClose distance for making objects invisible was set to 100 pixels in the previous
exercise. For our needs, this distance is, in fact, too close. You may that find a value
of 300 yields better results.
4
5
6
7
8
9
// set the viewer parameters
var d:Number = 600; // distance from viewer to picture plane
var viewerAngle:Number = 2; // the angular change of viewer
var viewerSpeed:Number = 10; // the viewer speed
var tooClose:Number = 300; // the too close distance
The displayObj() function has a test that restricts the z-movement of the viewer. In
the previous exercise, the maximum value the viewer could in the z-direction was 900
pixels. This may be a little closer than is necessary. Try a value of 700 pixels as shown,
or do some experimenting and come up with your own value.
 
Search WWH ::




Custom Search