07.12.2012 Views

Adobe Director Basics

Adobe Director Basics

Adobe Director Basics

SHOW MORE
SHOW LESS

You also want an ePaper? Increase the reach of your titles

YUMPU automatically turns print PDFs into web optimized ePapers that Google loves.

ADOBE DIRECTOR BASICS<br />

3D: Controlling action<br />

Each time the translate() action is executed, the color of the Child model is changed. The image below shows where<br />

the Child model ends up after each translate() action.<br />

Changing the node that acts as the frame of reference affects the distance and direction of a translate() action.<br />

Note the following points:<br />

The direction of the translation depends on the orientation of the reference node. In the example, the Child model's<br />

parent is aligned with the group("World"), but the camera is rotated 45° around the y-axis and Child model itself<br />

is rotated 60° around the y-axis.<br />

As a result, the translations illustrated in orange (relative to the parent) and green (relative to the world) both occur<br />

along the world's x-axis (the red line), but the other translations occur at different angles.<br />

The distance traveled depends on the scale of the node that acts as the frame of reference. The Parent model is scaled<br />

by a factor of 0.5, and its scale also affects the Child model. The group("World") is scaled by a factor of 1.0, and<br />

the camera is scaled by a factor of sqrt(2.0).<br />

As a result, the translations shown in orange (relative to the parent) and blue (relative to the Child model itself) are<br />

half the length of the translation relative to the world (shown in green). The translation relative to the camera<br />

(shown in red) is about 1.4 times longer than the translation relative to the world.<br />

Using a symbol shortcut, such as #self or #parent, has exactly the same effect as using an explicit reference to the<br />

associated node. If you do not include any reference to a node, then the node that you are moving is chosen by<br />

default as the frame of reference.<br />

As you watch the movie, the positions of the dark blue and light blue boxes (using no reference and #self) are<br />

identical, and the positions of the yellow and orange boxes (using #parent and model("Parent")) are also<br />

identical.<br />

Note: This example uses a camera that has been scaled by a factor other than 1.0. This is for the purposes of this<br />

demonstration only. Generally, changing the scale of a camera will not be necessary.<br />

Last updated 8/26/2011<br />

207

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

Saved successfully!

Ooh no, something went wrong!