07.12.2012 Views

Adobe Director Basics

Adobe Director Basics

Adobe Director Basics

SHOW MORE
SHOW LESS

Create successful ePaper yourself

Turn your PDF publications into a flip-book with our unique Google optimized e-Paper software.

ADOBE DIRECTOR BASICS<br />

3D: Controlling action<br />

Rear-view mirror<br />

You can use a very similar technique to create a rear-view mirror for a racing game. Simply create a secondary camera,<br />

add it to the sprite, and set it as a child of the user's vehicle, pointing backwards. To get a wide enough view for the<br />

rear-view mirror to be useful, you may wish to set the camera's projectionAngle property to a fairly large angle.<br />

Making the camera move naturally<br />

Your target audience is used to the camera movements used in the film industry. In the film industry, cameras are<br />

heavy and cannot be accelerated quickly. In a virtual world, a camera has no weight, so you can move it instantaneously<br />

from one point to another. However, your audience may see such movement as unnatural.<br />

Both the avatar that you are following and the camera must start moving slowly, and increase in speed. If the avatar<br />

accelerates quickly, it looks more natural if the camera lags behind initially, and then catches up when the avatar has<br />

reached its top speed.<br />

Instead of making the third-party camera follow at a fixed distance, you can vary the distance based on the changing<br />

speed of the avatar. One simple way to do this is to use the interpolate() and interpolateTo() methods.<br />

To see an example of the use of interpolateTo() to make the camera move more smoothly, download and launch<br />

the movie ElasticCamera.dir.<br />

Using interpolateTo() gives a natural lag between the movement of the avatar and the movement of the camera<br />

You can find more details on this technique at “Interpolation” on page 264.<br />

You can see an example of the transform.interpolate() method in the demo movie for “Moving to a given<br />

location” on page 225. In this example, a click on the Ground model will make the camera accelerate then decelerate<br />

as it arrives at its target position.<br />

Other ideas<br />

When navigating with the keyboard, you may prefer to ramp up to a maximum speed, and then continue to cruise at<br />

that speed, and finally ramp down to a halt when the user releases the mouse.<br />

With a third-person view, you can associate each of these stages with a different motion for the avatar. The avatar can<br />

start with an “Idle” motion, then adopt an “Idle to walk” motion, then continue with a “Walk” motion. When the user<br />

releases the movement key, the avatar can adopt a “Walk to Idle” motion, and then return to “Idle”. Each motion can<br />

be designed to move seamlessly into the next one.<br />

See “Pre-defined animations” on page 270 for more details.<br />

Last updated 8/26/2011<br />

236

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!