[Chimera-users] how to get translation and rotation vectors for move and turn commands

Jan Kosinski kosinski at embl.de
Tue May 13 11:07:33 PDT 2014

Dear Elaine,

Maybe I tried to simplify things too much ;-)

To explain a little bit better, I am constructing a complex movie scene 
with many models. For example, I load a first model, move and rotate it 
with mouse and move command to different positions and save these 
positions with savepos. During the movie, the model moves along the path 
of the saved positions until some final position. Then during the movie 
I load a second model, which is in the same initial position as was the 
initial position of the first model and has the same reference frame. 
Now, I want my movie to move this second model to a position next to the 
final position of the first model (with frames option). So I was 
thinking of getting the translation and rotation automatically so I can 
directly calculate the parameters for move and turn command.

I guess with matrixcopy and matrixset would work, but because I want to 
move with frames option for the movie, I would have to stop the movie, 
move the model, do savepos, reset to initial, and than use reset or fly. 
But if I could get the translation and rotation automatically, things 
would be more straightforward (I have a complex movie with dozens of 
models loading and moving around).

Related to this question is that for example I would like to 
automatically determine a x,y,z position in left corner of the window 
and then calculate x,y,z of the newly loaded model, calculate 
translation vector, and use move command to move the model to the corner.


On 05/13/2014 07:44 PM, Elaine Meng wrote:
> Hi Jan,
> I don't understand what you are doing,  thus I'm not sure if any of the following will help, but "matrixcopy" will apply the transformation of one model to another.  Or you can write a model's transformation matrix to a file with "matrixget" and apply a transformation matrix from a file to a model with "matrixset."
> <http://www.rbvi.ucsf.edu/chimera/docs/UsersGuide/midas/matrixcopy.html>
> <http://www.rbvi.ucsf.edu/chimera/docs/UsersGuide/midas/matrixset.html>
> See also "measure rotation":
> <http://www.rbvi.ucsf.edu/chimera/docs/UsersGuide/midas/measure.html#rotation>
> Elaine
> ----------
> Elaine C. Meng, Ph.D.
> UCSF Computer Graphics Lab (Chimera team) and Babbitt Lab
> Department of Pharmaceutical Chemistry
> University of California, San Francisco
> On May 13, 2014, at 10:17 AM, Jan Kosinski <kosinski at embl.de> wrote:
>> Hi,
>> I have the same model loaded in Chimera twice. One model has been moved to a different position and rotated manually using mouse.
>> How can I get x,y,z coordinates for the centers of the to models to calculate x,y,z axis definition compatible with the move command? And how to get rotation information for turn command?
>> I tried with cofr command but it seems to give coordinates in different reference frame. I would like to avoid using savepos/reset/fly commands in this case. Python solution would be fine.
>> Thanks in advance for your help,
>> Jan

Jan Kosinski, PhD
Structural and Computational Biology Unit
European Molecular Biology Laboratory (EMBL)
Meyerhofstrasse 1
69117 Heidelberg

More information about the Chimera-users mailing list