Trimesh2 rotates along X, Y, and Z axes.

Source: Internet
Author: User
Tags xform
// Zdd: rotate angle degrees along X, Y, and Z. // For example, rot_angle (90.0, 1.0, 0.0, 0.0) is rotated 90 degrees along the X axis void rot_angle (float angle, float X, float y, float Z) {VEC <3, double> x_axis (x, y, z); double ang = m_pi/180.0f * angle; /* // In order to display the model in the video center, an xFF matrix XForm xFF = XForm: Trans (0, 0,-3.5f/FOV * themesh-> bsphere is moved. r) * XForm: Trans (-themesh-> bsphere. center); XForm I _xff = XForm: Trans (themesh-> bsphere. center) * XForm: Trans (0, 0, 3.5f/FOV * themesh-> bsphere. r); XF = xFF * XForm: Trans (themesh-> bsphere. center) * XForm: rot (Ang, x_axis) * XForm: Trans (-themesh-> bsphere. center) * I _xff * XF; * // the preceding three lines are clear and simplified as follows: XF = XForm: Trans (0, 0,-3.5f/FOV * themesh-> bsphere. r) * XForm: rot (Ang, x_axis) * XForm: Trans (0, 0, 3.5f/FOV * themesh-> bsphere. r) * XF ;}
Related Article

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.