How to define a rotation point in Matrix?

Feel free to ask any question here
Post Reply
Elbruno
Posts: 32
Joined: Mon Jul 06, 2015 8:08 pm

How to define a rotation point in Matrix?

Post by Elbruno »

Hello people.

I'm sorry if this item has already been replied. I searched and did not find the answer.

I noticed that using the translate rotate you can set the point with a click and the cloud rotates around this point.

I would like to know how to set the rotation point when applying transformation with Matrix, Axis Angle or Euler angles.

Because in some cases I have just a point and a direction to align two different systems.

Thx very much.

Cheers.
daniel
Site Admin
Posts: 7713
Joined: Wed Oct 13, 2010 7:34 am
Location: Grenoble, France
Contact:

Re: How to define a rotation point in Matrix?

Post by daniel »

Well it's not easy because in a standard 4x4 transformation matrix, the translation part comes after the rotation.

Basically the 3x3 upper-left part of the matrix is a rotation and the last column is a translation. So a point P, is transformed as 'P' = R.P + T. This also explains why the second tab of the 'Apply transformation' dialog lets you define first a rotation (by its axis and rotation angle) and then a translation.

If you want to rotate about a given point C, you have to first center the cloud on this point (translation of '-C'). Then apply the rotation, and translate back to the initial coordinate system ('+C'). To be clearer, you have to use the 'Apply Transformation' dialog once with only a translation (-C). And then call the dialog a second time with the rotation you desire and '+C' as translation.

P' = R.(P-C) + C
Daniel, CloudCompare admin
Elbruno
Posts: 32
Joined: Mon Jul 06, 2015 8:08 pm

Re: How to define a rotation point in Matrix?

Post by Elbruno »

Ok.

It takes some steps but looks like functional.

Tyvm Daniel.
Post Reply