[chimera-dev] Accessing rotation matrix of molecule models

Thomas Goddard goddard@cgl.ucsf.EDU
Thu, 18 Jul 2002 17:18:56 -0700 (PDT)


Hi Mike,

  There is just one Xform per Chimera model that you access using

	model.openState.xform

You can set the transform of one model to be the same as another with

	model2.openState.xform = model1.openState.xform

The assignment copies the xform so each model will have its own copy.

  The xform first applies the rotation matrix and then a translation.
You probably see the translation changing when you rotate the molecule
because the center of rotation when using the mouse is not at the
origin (0,0,0).  (The center of rotation for mouse rotations can be
controlled -- see the Rotation tab of the Side View dialog.)

  When you get atom coordinates with atom.coord() you get the original
xyz values from say a PDB file.  The m.openState.xform applied to those
coordinates gives you the displayed xyz Chimera coordinates of the atom
taking into account the rotation and translation.  So you should apply
the xform before comparing distances between atoms in different molecules.

    Tom