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

t = transform()<br />

t.position = vector(2,3,5)<br />

t.rotation = vector(30, 45, 60)<br />

t.scale = vector(0.5, 1.0, 2.0)<br />

trace(showTransform(t))<br />

-- "<br />

0.17678 0.30619 -0.35355 0.00000<br />

-0.57322 0.73920 0.35355 0.00000<br />

1.47840 0.56066 1.22474 0.00000<br />

2.00000 3.00000 5.00000 1.00000<br />

"<br />

i = t.inverse()<br />

trace(showTransform(i))<br />

-- "<br />

0.70711 -0.57322 0.36960 0.00000<br />

1.22474 0.73920 0.14017 0.00000<br />

-1.41421 0.35355 0.30619 0.00000<br />

1.98262 -2.83892 -2.69063 1.00000<br />

"<br />

put showTransform(t*i) -- this creates an identity transform<br />

-- "<br />

1.00000 -0.00000 -0.00000 0.00000<br />

0.00000 1.00000 -0.00000 0.00000<br />

0.00000 0.00000 1.00000 0.00000<br />

0.00000 0.00000 0.00000 1.00000<br />

"<br />

Note: JavaScript does not support the multiplication of transforms.<br />

i.invert() -- i will now be identical to t<br />

trace(showTransform(i))<br />

-- "<br />

0.17678 0.30619 -0.35355 0.00000<br />

-0.57322 0.73920 0.35355 0.00000<br />

1.47840 0.56066 1.22474 0.00000<br />

2.00000 3.00000 5.00000 1.00000<br />

"<br />

t.identity()<br />

trace(showTransform(t))<br />

-- "<br />

1.00000 0.00000 0.00000 0.00000<br />

0.00000 1.00000 0.00000 0.00000<br />

0.00000 0.00000 1.00000 0.00000<br />

0.00000 0.00000 0.00000 1.00000<br />

"<br />

Applying a preliminary manipulation to a transform<br />

The following commands reset the transform to its identity state, apply a modification to the identity transform, and<br />

then re-apply the original transform to the new state.<br />

transform.preTranslate()<br />

transform.preRotate()<br />

transform.preScale()<br />

Last updated 8/26/2011<br />

376

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

Saved successfully!

Ooh no, something went wrong!