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

Mapping<br />

The image below shows where the vertex points appear for the terrain mesh, and provides the index number for each<br />

vertex point.<br />

The faces in the mesh model are shown as triangles<br />

[[0.00, 1.00], [0.33, 1.00], [0.67, 1.00], [1.00, 1.00],<br />

[0.00, 0.67], [0.33, 0.67], [0.67, 0.67], [1.00, 0.67],<br />

[0.00, 0.33], [0.33, 0.33], [0.67, 0.33], [1.00, 0.33],<br />

[0.00, 0.00], [0.33, 0.00], [0.67, 0.00], [1.00, 0.00]]<br />

The list above shows how each of the indexed vertex points maps to the floating point coordinates in the texture. To<br />

make it easier to follow what is happening, the MapToTerrain.dir creates the vertex points and the texture coordinates<br />

in an order that appears logical when printed on a page. The actual order of items in these lists is not important, so<br />

long as both lists use the same order.<br />

Note that neither changing the image of the texture, nor changing the texture used by the shader will have any effect<br />

on the mapping. The same relative positions within the texture image will be used, regardless of the absolute<br />

dimensions of the image.<br />

Defining faces in a mesh<br />

Each face in a mesh is defined by a list of three integers, representing the index numbers of the vertex points at each<br />

corner. For example, the face at the top left corner can be defined as [1, 5, 2]. Note that faces are always defined in<br />

counter-clockwise order.The faces themselves can be defined in any order. In the MapToTerrain.dir movie, for<br />

simplicity, they are defined in the same order as the text is read. The top left face thus has a faceID of 1.<br />

Determining which pixel is at a given uv coordinate<br />

When used with the #detailed option, the and member3D.modelsUnderRay() functions allow you to discover the<br />

point where a ray intersects with a given face of a give mesh of a given model. The output from these functions is in<br />

the form of a list of property lists:<br />

Last updated 8/26/2011<br />

152

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

Saved successfully!

Ooh no, something went wrong!