Away3d Study Notes 3-3D world coordinate system

Source: Internet
Author: User

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.

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.