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

Jan Kosinski kosinski at embl.de
Tue May 13 11:52:27 PDT 2014

Dear Tom and Elaine,

Thanks a lot! I tested a bit and seems I have a toolbox to do all what I 
need now :-)

One more related question in a separate thread ;-)


On 05/13/2014 08:25 PM, Tom Goddard wrote:
> Hi Jan,
>    While you could make the movie by specifying numbers for translations and rotations, this is a hard way to do it.  The “measure rotation” command that Elaine suggested would help you get the numbers you would need.  But a much easier way is to use savepos and reset commands.  “savepos pos1” saves the current positions of all models and the camera view and names it pos1, then “reset pos1 50” will smoothly move models from wherever they are now to pos1 over 50 frames.  To make a movie I usually open all my models, save lots of positions with savepos, then save a Chimera session.  I also make a command script that contains lots of reset and wait commands.  This scheme of movie making involving making a Chimera session (movie1.py) that saves all your interesting positions, and a separate command script (movie1.cmd).  The command script will also hide and show specific models, change their colors or display styles if I want those to change during the movie.
> 	Tom
> On May 13, 2014, at 11:07 AM, Jan Kosinski  wrote:
>> 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.
>> Cheers,
>> Jan
>> 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
>> Germany
>> _______________________________________________
>> Chimera-users mailing list
>> Chimera-users at cgl.ucsf.edu
>> http://plato.cgl.ucsf.edu/mailman/listinfo/chimera-users

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