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

Note: Ensure that the name you provide for the new resource and the modelResource type is unique.<br />

The following code creates a new modelResource of the type #sphere in the member “3D”, and then creates a model<br />

from the resource:<br />

-- Lingo syntax<br />

v3DMember = member("3D")<br />

vName = "Sphere"<br />

vResource = v3DMember.newModelResource(vName, #sphere)<br />

vModel = v3DMember.newModel(vName, vResource)<br />

// JavaScript syntax<br />

<br />

vName = "Sphere";<br />

vResource = v3DMember.newModelResource(vName, symbol("sphere"));<br />

vModel = v3DMember.newModel(vName, vResource);<br />

Geometry of a regular primitive resource<br />

The origin point of a regular primitive resource is at its center. The default dimensions of the #sphere, #box, and<br />

#cylinder primitives give them a width, height, and length of 50 world units.<br />

The default size of the #plane primitive gives it a width and a length of 1 unit. The #plane resource's length property<br />

actually determines its height. The #plane primitive is rotated so that it is visible from the default camera position. To<br />

create a horizontal plane, rotate the model -90° around the world's x-axis.<br />

Modifying the mesh of a primitive resource<br />

You can obtain a wide variety of shapes by modifying the various properties of the regular primitives. For example,<br />

you can create hemispheres, cones, tubes, rectangular fences, and other shapes. You cannot set the position of a<br />

particular vertex point in a primitive modelResource directly, but you can apply the #meshDeform modifier to a model<br />

created from a primitive modelResource, and use the meshDeform modifier to move vertex points around. See<br />

“MeshDeform modifier” on page 186 for details.<br />

Creating an extruder resource<br />

The extrude3d() function is designed to create an #extruder resource from a text cast member. However, you can<br />

change the vertexList property of an #extruder resource after it has been created.<br />

Extruding text<br />

To see an example of using an extruder to create three-dimensional text in a 3D cast member, download and launch<br />

the movie 3dExtruder.dir.<br />

Last updated 8/26/2011<br />

166

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

Saved successfully!

Ooh no, something went wrong!