This is tricky because the view matrix isn't quite the same format as the
coordinates translation matrix.  Here's some code that will do what you
want:

# transform selection coordinates by the camera view

cv=list(cmd.get_view())

cmd.transform_selection("all", \
  cv[0:3]+[0.0]+ \
  cv[3:6]+[0.0]+ \
  cv[6:9]+[0.0]+ \
  cv[12:15]+[1.0])

cmd.reset()

Cheers,
Warren


--
Warren L. DeLano, Ph.D.                     
Principal Scientist

. DeLano Scientific LLC  
. 400 Oyster Point Blvd., Suite 213           
. South San Francisco, CA 94080    
. Biz:(650)-872-0942  Tech:(650)-872-0834     
. Fax:(650)-872-0273  Cell:(650)-346-1154
. mailto:war...@delsci.com      
 

> -----Original Message-----
> From: pymol-users-ad...@lists.sourceforge.net 
> [mailto:pymol-users-ad...@lists.sourceforge.net] On Behalf Of 
> Bingding Huang
> Sent: Thursday, April 21, 2005 1:36 AM
> To: pymol-users@lists.sourceforge.net
> Subject: [PyMOL] orient the molecule
> 
> Hi,
> When I try "orient" command to orient the molecule, the 
> camera changes but the coodinates don't change.
> I wonder whether it is possible that when I orient the 
> molecule the coodinates also change.
> 
> Thanks
> 
> Bingding
> 
> 
> 
> -------------------------------------------------------
> This SF.Net email is sponsored by: New Crystal Reports XI.
> Version 11 adds new functionality designed to reduce time 
> involved in creating, integrating, and deploying reporting 
> solutions. Free runtime info, new features, or free trial, 
> at: http://www.businessobjects.com/devxi/728
> _______________________________________________
> PyMOL-users mailing list
> PyMOL-users@lists.sourceforge.net
> https://lists.sourceforge.net/lists/listinfo/pymol-users
> 



Reply via email to