From: Charles Moad (cmoad_at_indiana.edu)
Date: Wed Apr 13 2005 - 18:40:54 CDT

The scale is flat out wrong if I don't adjust it. I am expecting a line
from the center of the scene to the first alpha carbon. (code below)
It is close so I am guessing there needs to be some small adjustment to
the center/translation. The rotations are identical.

Thanks for looking at this,
        Charlie

-------------------------------------------------------
import Molecule as mol
import AtomSel as sel
import vmdnumpy
import graphics as gl
import molecule
import trans

m = mol.Molecule()
m.load('1di9', filetype='webpdb')
mid = int(m)

cas = sel.AtomSel('name CA', mid)
cas.frame(0)

cgo = molecule.load('graphics', 'test')
# Move to pdb coord system
trans.set_center(cgo, trans.get_center(mid))
trans.set_scale(cgo, trans.get_scale(mid))

x, y, z = cas.get('x', 'y', 'z')
gl.color(cgo, 'red')
gl.line(cgo, (0,0,0), (x[0], y[0], z[0]), width=3)
-------------------------------------------------------

John Stone wrote:
> Charles,
> Can you send me the script you're performing these commands within?
> I can probably be more helpful if I could see what you're actually doing
> beyond these two lines. The scale command you've got there may be causing
> troubles. When you say it does not appear correct, do you have any
> judgement as to whether the origin, scale, or both are being drawn incorrectly
> for your graphics object? Did you do anything else with your transforms
> before this code is executed, or after?
>
> John Stone
> vmd_at_ks.uiuc.edu
>
> On Sun, Apr 10, 2005 at 07:13:31PM -0500, Charles Moad wrote:
>
>>What is the correct way to draw a graphics object in a pdb's coordinate
>>system in python? I tried:
>>
>>trans.set_center(cgo, trans.get_center(mid))
>>trans.set_scale(cgo, trans.get_scale(mid))
>>
>>Where cgo is the id of the graphics object, and mid is the molecule's id.
>>
>>This does not appear correct.
>>
>>Thanks,
>> Charlie
>
>