Graphics Programs Reference
In-Depth Information
100
101
102
103
104
105
106
107
108
// use mouse for horizontal & vertical viewer movement
//viewer.x += (_xmouse - scene3D._x)/viewerSpeed;
//viewer.y += -(_ymouse - scene3D._y)/viewerSpeed;
// check keys to adjust viewer movement
if (Key.isDown(Key.UP)) {viewer.z += viewerSpeed;}
else if (Key.isDown(Key.DOWN)) {viewer.z -= viewerSpeed;}
if (Key.isDown(Key.RIGHT)) {viewer.x += viewerSpeed;}
else if (Key.isDown(Key.LEFT)) {viewer.x -= viewerSpeed;}
Let's see where we are at this point. Save your movie as 7_4_glassCam_DONE.fla and
test it. You should get results similar to Figure 7.25. Clearly, one of the things we need
to do is bring the glasses closer together in the x-direction. It would also be helpful to
raise the glasses and more closely center the images vertically.
Figure 7.25 Intermediate step of glassCamDone.swf
Step 6: Modify the coordinate data
The maximum width of the glasses is about 150 pixels, so spacing them out horizontally
every 160 pixels should provide spacing between the glasses. Change the x-coordinate
data array to that shown.
 
Search WWH ::




Custom Search