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

See “Hugging Terrain” on page 238 for a simple script that generates a rectangular terrain from data in a heightmap<br />

Bitmap member. White pixels are high points, black pixels are low points, and gray pixels create a gradient in<br />

between. The Bitmap member's regPoint is used as the origin for the terrain mesh.<br />

See “Terrains” on page 319 for a more comprehensive script that generates a terrain from a height-map. This script<br />

also automatically creates a terrain object which uses the Dynamiks Physics Xtra extension to ensure that rigidBody<br />

objects do not pass through the terrain mesh. The mesh generator primitive’s type property is #mesh and is created<br />

by the member’s newMesh() method. The parameters included with that method describe how large the mesh will be.<br />

You can use the mesh deform modifier to manipulate vertex positions at runtime for #mesh or any other type of model<br />

resource. You can also use the #mesh primitive to change mesh properties directly.<br />

Ingredients<br />

All types of model resource (except for the Particle resource) store five types of information:<br />

A list of vertex points<br />

A list of normal directions<br />

A list of colors<br />

A list of texture coordinates<br />

Information on each of the faces. This information includes:<br />

Which vertex point is at each corner of the triangular face<br />

The color of each vertex<br />

The normal at each vertex<br />

The shader for the face (this determines which mesh it belongs to)<br />

The texture coordinates for the face<br />

The faces that share a neighboring edge<br />

To create a model resource of the type #mesh, provide all this information, or rely on appropriate default values.<br />

Imagine that you want to create a trick playing card which can be used to display either a Jack of Spades or a Queen of<br />

Hearts. To help you visualize this, download and launch the movie TrickCard.dir.<br />

You can simulate a trick playing card with 8 vertices and 12 triangular faces<br />

Last updated 8/26/2011<br />

171

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

Saved successfully!

Ooh no, something went wrong!