VTK matrix management system

Source: Internet
Author: User

Vtktransform * form = vtktransform: New ();
Form-> identity (); // unitization
 
Form-> rotatez (45 );

Sphere1-> addposition (3.0, 0.0, 0.0 );

Form-> rotatez (45 );

Sphere1-> setusertransform (form );

 

 

AboveCodeRotate for 45 degrees consecutively. Each rotation is performed along the model coordinate system, and the function for adjusting the position takes effect.

The reason is that rotatez (45) generates a matrix of 45 degrees of Rotation along the Z axis. This matrix indicates a matrix with the origin as the center and (0, 0, 1) as the axis.

The translation matrix generated by addposition () does not affect the rotation matrix. Therefore, the position of the addposition () function is irrelevant to the final result.

That is, the above Code is equivalent to the following

 

Vtktransform * form = vtktransform: New ();
Form-> identity (); // unitization
 
Form-> rotatez (45 );

 

Form-> rotatez (45 );
Sphere1-> addposition (3.0, 0.0, 0.0 );
Sphere1-> setusertransform (form );

 

 

 

 

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.