OSG coordinate system

Source: Internet
Author: User

1, World coordinate world coordinate system describes all the objects in the whole scene, can be understood as absolute coordinate system, the position of all objects are absolute coordinates. As a whole, it provides an absolute reference to the position of all objects, thus avoiding the confusion of the coordinate system caused by the independent object coordinate system.

2. Object coordinate system

Each object has its own coordinate system, and when an object is exchanged, it is actually the process of its own coordinate system in relation to the world coordinate system. The object coordinate system usually describes the problem is the internal object of a particular object, mainly including the vertex of the object, the object's normal vector and the direction of the object.

3. Camera coordinate system

The camera coordinate system is similar to the screen coordinate system except that the camera coordinate system is in 3D space and the screen coordinate system is in 2D space.   OSG coordinate system: x positive direction right, y positive direction, z positive direction upward.   ***** Coordinate System Transformation * * * * Object coordinate system, world coordinate system        #-> calculate the coordinates of a particular node in the world coordinate system in the scene, You only need to multiply the root node and all the transformation matrices between the nodes.        #-> implementation:                   ;  callback, accessor, etc.                   The accessor is a convenient and controllable way, relative to the extent that callbacks are not subject to class manipulation, and will affect rendering efficiency by adding additional overhead.                 $-> accessor implementation:              &NBS P The     accessor records the path of the nodes in the scene by traversing, calculates the world coordinates of the matrix transformations on the path, and finally returns the world coordinates represented by a moment form, as shown in the example code in the OpenSceneGraph three-dimensional rendering engine Programming Guide:                                  &NBSP ;                                                 ***** screen coordinates-world coordinates *****                         OSG China forum http://bbs.osgchina.org /forum.php?mod=viewthread&tid=4240&highlight=%bd%da%b5%e3%2b%ca%c0%bd%e7%d7%f8%b1%ea about getting the world coordinates of a child node under the root node , array gives the answer:                        geode->getbound (). Center () * Osg::computelocaltoworld (geode->getparentalnodepaths () [0])      //tested, it is possible to obtain the world coordinates of the child nodes, It is said to be the simplest method.

OSG coordinate system

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.