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 />

Operation Description Output<br />

vector1 - vector2 Returns a new vector representing the displacement<br />

from the position of vector 2 to the position of<br />

vector1.<br />

vector1 * vector2 Returns the dotProduct() of the two vectors. See<br />

below.<br />

vector1 / vector2 Meaningless operation. 0<br />

transform * vector Returns a new vector that translates, rotates and<br />

scales the vector by the amounts defined in the<br />

transform.<br />

transform + vector<br />

transform - vector<br />

transform / vector<br />

vector + transform<br />

vector - transform<br />

vector / transform<br />

Uses of binary operations<br />

Meaningless operations. 0<br />

Meaningless operations. 0<br />

Last updated 8/26/2011<br />

A new vector object<br />

A floating-point value<br />

A new vector object<br />

vector * transform Operation not supported. *** Script error ***<br />

Operation Uses<br />

-vector If the vector is a translation, reverses the direction of the translation.<br />

vector * scalar Scales a vector<br />

vServerToReceiver = vReceiver.worldPosition -<br />

vServer.worldPosition<br />

-- (see vector1 - vector2 below)<br />

vReceiverToServer = -vServerToReceiver<br />

If the vector is a unit direction vector, and the scalar is the distance to travel, the result<br />

is a translation vector.the distance to travel, the result is a translation vector.<br />

vSpaceShip.translate(vDirectionVector * vDistance)<br />

vector / scalar Divides a vector into smaller steps. If the vector is a translation vector and the scalar<br />

is a number of frames, the result will be the translation to move on each frame.<br />

vMovementPerFrame = vTotalMovement / vNumberOfFrames<br />

vector1 + vector2 1) If vector1 is a position and vector2 is a translation, the result is a new position.<br />

vNewPosition = vOldPosition + vTranslation<br />

2) If vector1 and vector2 are both translations, then the result is a new translation<br />

that combines both movements<br />

vDiagonalMotion = vForwardMotion + vSidewaysMotion<br />

368

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

Saved successfully!

Ooh no, something went wrong!