From: SAPAY Nicolas 232321 (Nicolas.SAPAY_at_cea.fr)
Date: Thu Dec 01 2011 - 04:22:34 CST

I have browsed the source code of VMD and finally discovered what I need. The camera position can be obtained with the following command:

   display get eyepos

Unfortunately, this command is not explained in the documentation. Now, I can easily obtain the focal length

   display get focal length

and the focal distance

   vecdist [molinfo 0 get center] [display get focal length]

Now, I just have to set the aperture, which can be easily done.

Nicolas

________________________________________
De : owner-vmd-l_at_ks.uiuc.edu [owner-vmd-l_at_ks.uiuc.edu] de la part de SAPAY Nicolas 232321
Date d'envoi : mercredi 30 novembre 2011 17:20
À : vmd-l_at_ks.uiuc.edu
Objet : vmd-l: Get the camera position

Hello,

I want to render a Renderman scene (.rib file) with a focus on a particular part of my scene. In Renderman, this is controlled by the DepthOfField command which accepts as options the aperture number, the focal length and the focal distance. The focal length can be obtained with the display command:

display get focallength

But I still need to calculate the focal distance, i.e. the distance along the direction of the view at which objects will be in focus. Im my case, this should be the distance between the VMD camera and the (geometrical) center of my scene. Is there a way to get the camera position (in VMD coordinates)? I also wonder what is the correspondance between the VMD coordinates and the RIB file coordinates. Do they are the same?

Nicolas

--
[ Nicolas Sapay ]
Molecular Modeling and Biocomputing
Commissariat à l'Energie Atomique - Grenoble, France
Tel : +33 (0)4 38 78 48 48