User Guide

382 Chapter 16: Working with Models and Model Resources
Motion methods
Use this method to work with motions:
About lights and cameras
Lights illuminate the 3D world and the models in it. Without lights, the world exists, and actions
can take place, but users see nothing. You can add lights to your 3D world in your 3D modeling
application or with the Property inspector. For information about the Property inspector, see
Chapter 14, “3D Basics,” on page 303. You can also add and remove lights, change their color or
position, and manipulate their parent-child relationships using methods and properties. Those
methods and properties are detailed here. You can find the same lighting methods and properties,
with more detailed syntax and coding examples, in the Scripting Reference topics in the Director
Help Panel.
Cameras act as windows into a 3D world. Each camera that exists in a 3D cast member offers a
different view into it, and each sprite that uses a 3D cast member uses one of these cameras. A
cameras position can be moved with the Property inspector or the Shockwave 3D window. You
can also use the Director 3D behaviors or script to manipulate camera positions. For information
about the Property inspector and the Shockwave 3D window, see Chapter 14, “3D Basics,
on page 303. For information about behaviors, see Chapter 15, “The 3D Cast Member, 3D Text,
and 3D Behaviors,” on page 315. More complex manipulations require the use of methods and
properties. Accessing the properties and methods of a light or camera requires that the member be
on the Stage or explicitly and completely loaded with the
preLoad() method. When using the
preLoad() method, you can verify that the load is complete by testing whether member.state =
4
(loaded).
Lights and cameras have the same transform methods and parent-child properties as models and
groups. Lights and cameras can be added, deleted, cloned, moved, and rotated in the same ways as
models and groups. You can access their names, parents, children, and other properties in the
same way you would with models and groups. However, there are some important differences,
which arise from the specific roles that lights and cameras play in the 3D world.
Method Description
map(motion, "bone name")
Maps the given motion into the current motion beginning
at the named bone.
If no bone name is specified, the mapping begins at the
root bone.
The
map() method will replace any motion tracks mapped
previously to the specified bone and all of its children.
Motion mapping has no effect on motions that are already
on a play list. The
map() method does not work with
keyframe animations.