Technorati label: 3D coordinates
There are two types of coordinates in away3d: World coordinates and self-coordinates.
Through Note 2, we know what we need to do in the away3d world. Adding 3D objects to scenes is one of the tasks. Have you ever thought about how to specify the location of a 3D object when adding a 3D object? The movement and rotation of 3D elements will be learned later. So how can we determine that 3D elements have been moved and rotated? I have learned how to determine the motion of an object in junior high school physics. We need to select a reference object first. To solve this problem, we also need to select a reference object and use coordinates as the reference in away3d.
There are two types of coordinates in away3d: World coordinates and self-coordinates.
World coordinates
3D world coordinates are different from those in flash. Flash coordinates only have two axes (x/y). The coordinates are the origin point in the upper left corner of the Flash video, and the right is the bottom right. 3D world coordinates are three axes (x/y/z), such:
The Z axis of the world coordinates is perpendicular to the plane of the view and passes through the geometric center of the view.
Self-Coordinates
Each 3D element has its own coordinates. By default, when a new 3D element is created, its own coordinates coincide with the world coordinates. Create a new ball (Basic 3D element). The coordinates of the ball overlap with those of the world.
Figure 1
When a 3D element is moved or rotated, its own coordinates also move and rotate.
Figure 2
Sphere. rotationz = 30;
Set the rotationz attribute of Sphere in figure 1 to 30 to figure 2, that is, rotate the ball along Z. For ease of analysis, I have a black line on the cursor to show the world coordinates x/y. Compare the two coordinate systems in 2 to see their own coordinates.