* dee...@iastate.edu <dee...@iastate.edu> [2002-08-20 07:03] wrote:
> On Sat, Aug 17, 2002 at 10:23:46PM +0200, Bartholomeus Kuettner wrote:
> > Hello there!
> > 
> > I followed mailing list instructions to create cgo based labels via a python
> > script. Unfortunately, the labels are not in plane but more like
> > perpendicular. So is there a way to alter the orientation of such cgo
> > labels. I think one could apply pymol's "set_view" matrix to the labels to
> > get them in plane. Wrong idea? Anyway, how one can rotate the cgo labels
> > without rotating the remaining molecule?
> 
> I don't have an answer ready-made for you, but there is a brief mention[1]
> of this problem in the pages Kristian Rother gave a link to several days
> ago.[2]
> 
> [1] http://www.rubor.de/bioinf/pymol_tips.html#cgolabels

That would be my response to a CGO label question back in May.

You could use the cmd.rotate and cmd.translate to position the labels,
but it is likely to be somewhat painful. If I'm not mistaken, the
rotation will always be about and axis through the origin and so you may
need to translate the label into the correct position.

Thus if you have your label in an object called 'text', you could do,

  cmd.rotate(axis='x',angle=20.,object='text')

and repeat this with different angles, until you get the orientation
correct.  Then use:

  cmd.translate(vector='[1.,2.,3.]',object='text')

(using the appropriate vector, of course!) to position the label.

Not ideal, but if it is sufficiently important, it can be done!

Cheers,
Robert
-- 
Robert L. Campbell, Ph.D.               http://biophysics.med.jhmi.edu/rlc
r...@k2.med.jhmi.edu                                    phone: 410-614-6313
Research Specialist/X-ray Facility Manager
HHMI/Dept. of Biophysics & Biophysical Chem., The Johns Hopkins University
    PGP Fingerprint: 9B49 3D3F A489 05DC B35C  8E33 F238 A8F5 F635 C0E2

Reply via email to