From: Ashar Malik (asharjm_at_gmail.com)
Date: Wed Mar 21 2018 - 13:29:17 CDT

Hi Peter,

I think you are mixing 2 things here.

The 4*4 matrix that you have is a composite of 4 things. 3 3D angles called
roll, pitch and yaw and 1 traslation vector.

As per my long answer that I didn't actually write (now thinking of should
have) your final position will depend on which the order in which you apply
the 3D rotations. So meaning that roll of 30 degrees applied first followed
by pitch and yaw each of 30 degrees is not the same as if you apply pitch
first followed by roll and yaw.

Secondly, these angles are applied using the body itself as a reference and
not the 3 axis. For you to apply roll pitch yaw in a manner similar to
rotations about x, y , zaxis you would first have to translate your system
to the origin. Following that step with rotation commands like the one you
tried will produce new conformers, however a missing translation part would
mean that all confirmations you generate would be over each other and hence
not helpful.

You can recover roll, pitch and yaw from the values in the matrix using the
three formulas listed here:

 http://planning.cs.uiuc.edu/node103.html

However, I doubt that would be much help.

On Mar 22, 2018 05:34, "Peter Mawanga" <peter.mawanga.lagos_at_gmail.com>
wrote:

> Hello VMD users
>
> I have a Transformation Matrix:
>
> -8.055069e-01 1.664229e-01 5.687372e-01 6.593901e+01
> 2.020147e-01 9.793824e-01 -4.700835e-04 -1.096723e+01
> -5.570895e-01 1.145146e-01 -8.225191e-01 -3.810996e+00
> 0.000000e+00 0.000000e+00 0.000000e+00 1.000000e+00
>
> And I would like to decompose it into individual rotations and
> translations along XYZ axes. I used this online tool:
> https://www.andre-gaschler.com/rotationconverter/ and converted the 3 x 3
> matrix (excluding the 4th row and column) into the individual axial
> rotations.
>
> But upon applying the rotations successively along XYZ axes and then doing
> translation along all the three axes gives me a different final coordinate
> value.
>
> Please check the Tcl script used below:
>
> ===================================================
>
> set sel [atomselect top all]
> set com [measure center $sel]
>
> $sel moveby [vecscale -1.0 $com]
> $sel move [transaxis x 14.7782375]
> $sel move [transaxis y 144.6951609]
> $sel move [transaxis z 4.574389]
> $sel moveby $com
>
> $sel moveby {65.939008 -10.967225 -3.810996}
>
> animate write pdb test.pdb
> $sel delete
>
> ===================================================
>
> Is there any modification required in the script? Please let me know.
>
> --
> Thanks
> Peter
>