|
Flash CS4 Resources |
Performing complex 3D transformationsThe Matrix3D class lets you transform 3D points within a coordinate space or map 3D points from one coordinate space to another. You don't need to understand matrix mathematics to use the Matrix3D class. Most of the common transformation operations can be handled using the methods of the class. You don't have to worry about explicitly setting or calculating the values of each element in the matrix. After you set the z property of a display object to a numeric value, you can retrieve the object’s transformation matrix using the Matrix3D property of the display object’s Transform object: var leafMatrix:Matrix3D = this.transform.matrix3D; You can use the methods of the Matrix3D object to perform translation, rotation, scaling, and perspective projection on the display object. Use the Vector3D class with its x , y , and z properties for managing 3D points. It can also represent a spatial vector in physics, which has a direction and a magnitude. The methods of the Vector3D class let you perform common calculations with spatial vectors, such as addition, dot product, and cross product calculations. Note: The Vector3D class is not related to the ActionScript Vector
class. The Vector3D class contains properties and methods for defining
and manipulating 3D points, while the Vector class supports arrays
of typed objects.
|