What's New in Director 8.5 > Working with Models and Model Resources > Models > Moving models |
![]() ![]() ![]() |
Moving models
Because the 3D world has no absolute frame of reference, moving and rotating is much more complex than in 2D, where all movement is in relation to screen position.
In 3D, everything is drawn relative to the camera's frame of reference. If the camera is behind an object, when the object moves to the left relative to the center of the world, or world origin, it appears to move toward the right of the screen.
Each piece of position and orientation information can be expressed relative to one or more frames of reference. A model's transform property, for instance, expresses its position and rotation relative to the model's parent. In general, there are four frames of reference to consider: relative to the object (model, light, camera) itself, relative to the object's parent, relative to the world, and relative to some other object.
![]() |
Object-relative: When you create a model in a 3D modeling program, you build it relative to its own frame of reference. For instance, when you create a model of a car, the front of the car may be pointed along its Z axis and the antenna may be pointed along its Y axis. To move such a car forward (along its Z axis) regardless of which direction it is pointing relative to the camera or the world, use |
The car model might have wheel models as children. To rotate the wheel of a car relative to itself, rather than relative to its parent (the car), use the following Lingo: |
|
|
|
or |
|
|
|
where the fourth parameter of the |
|
![]() |
Parent-relative: A model's |
![]() |
World-relative: If you want the car to move along the world's X axis regardless of which way it is facing, use |
![]() |
Relative to another object: If you want to move an object so that it goes toward the right edge of the screen, use |
![]() ![]() ![]() |