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

The uvCoord list reports that the point under the mouse is 0.27 along the u axis and 0.53 along the v axis for this face.<br />

The u axis for a face starts at the first corner (here, index 1: [0.00, 1.00]) and points towards the second corner (here,<br />

index 5: [0.00, 0.67]). The v axis starts at the first corner and points towards the third corner (here, index 2: [0.33,<br />

1.00]). In this case, the axes are vertical and horizontal, which simplifies the calculation. (The MapPointToTexture()<br />

handler takes care of more complex cases where the two axes are not vertical and horizontal and not at right-angles to<br />

each other).<br />

vFloatDistanceFromBottom = 1.00 + (0.27 * (0.67 - 1.00))<br />

put vFloatDistanceFromBottom<br />

-- 0.91<br />

vFloatDistanceFromLeft = 0.00 + (0.53 * (0.33 - 0.00))<br />

put vFloatDistanceFromLeft<br />

-- 0.17<br />

To convert these values into a position within the texture image, you need to take into account the dimensions of the<br />

texture image, and the fact that the vertical float value is calculated from the bottom:<br />

vImageWidth = 256<br />

vImageHeight = 128<br />

vLocH = integer(vImageWidth * vFloatDistanceFromLeft)<br />

put vLocH<br />

-- 45<br />

vLocV = integer(vImageWidth * (1.0 - vFloatDistanceFromBottom))<br />

put vLocV<br />

-- 11<br />

Drawing on a 3D model<br />

You can use this technique to draw on the surface of a model. To see this in action, download and launch the movie<br />

DrawOn3D.dir.<br />

The DrawOn3D.dir movie uses the Map Point To Texture script to let you draw on a texture image<br />

Rendering<br />

Rendering determines which software and hardware technologies are applied to the 3D data before it is displayed on<br />

the screen.<br />

Not all computers are created equal. What looks good on your development machine may result in poor quality<br />

graphics or slow performance on some end-users' computers.<br />

Last updated 8/26/2011<br />

154

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

Saved successfully!

Ooh no, something went wrong!