Ogre local space, parent node space, World Space

Source: Internet
Author: User

The local space is the coordinate system that uses the point of the object as the origin of the coordinate system;

The space of the parent node is the coordinate system where the parent node is located;

The World Space is the coordinate system with (0, 0, 0) as the coordinate origin.

By default, scene nodes change the space to the parent node space (ts_parent). Therefore, when using the parent node space transformation, no additional settings are required:

Mscenenode-> translate (100.0, 10.0, 0.0 );

 

However, if you need to perform node transformation in the world space, call the following method:

 

Mscenenode-> translate (100.0, 10.0, 0.0, ts_world );

 

The same is true for Ontology space transformation. The following indicates moving a node "Forward" 100 units along its orientation:

 

Mscenenode-> translate (0.0, 0.0, 100.0, ts_local );

 

The default space for rotating scene nodes is local space (ts_local). If you need different rotating spaces, you must explicitly inform ogre:

 

// The object rotates a radian around its Y axis, with an angle of about 57.

Mscenenode-> yaw (Ogre: radian (1.0 ));

 

// Rotate the Radian of an object around the X axis of the parent node, which is about 57 degrees.

Mscenenode-> pitch (Ogre: radian (1.0), ts_parent );

 

// Rotate a radian In the Z axis of the object around the world, with an angle of about 57

Mscenenode-> Roll (Ogre: radian (1.0), ts_world );

 

No relational space is required for scaling. It is executed on the node itself and affects all subnodes of the node.

 

// Zoom twice on the X axis, but not on other Axes

Mscenenode-> Scale (2.0, 1.0, 1.0 );

 

 

Tip: If you find that the entity model suddenly changes when you scale the scene node. This may be because the normal is scaled together, because the light calculation will reference the data of the standard normal, and the scaled normal will have a corresponding impact on the calculation. The solution is to call the setnormalisenormals () method after scaling, but this also consumes some execution efficiency.

 

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.