From: John Stone (
Date: Tue Dec 16 2014 - 20:23:25 CST

  The way that 3-D picking works is to imaging that when you select a
point on the 2-D screen, a ray with an origin at the camera position is
generated, and this ray is tested for intersection against geometry
shown on the display. The nearest geometry shown on the display that
is intersected by this picking-test ray is then considered to be "picked",
and VMD (or any similar program) proceeds by figuring out what "object"
(an atom in the case of VMD) was associated with the geometry that was
"picked". In the case that you don't have an atom or associated graphics
geometry shown, then you would have nothing for the picking test to
intersect the ray with, so there isn't a 3-D cartesian coordinate
associated with the picking operation. If you want to compute the ray
that would be associated with a mouse picking operation over an area
of empty space, that can be done with some linear/matrix algebra using
the VMD viewing matrices. If you only want the 2-D screen space coordinate
associated with the mouse pick, that is available through a simple scripting
callback when the mouse is set to "user" mode. Let me know if any of these
is what you're looking for.

  John Stone

On Tue, Dec 16, 2014 at 06:11:48PM -0500, Xinqiang Ding wrote:
> Dear all,
> How can we get the coordinate of the mouse arrow in VMD? I know that if there is an atom, we can select that atom, then see their coordinates using label. But how can I get the coordinate of the point which the mouse arrow is pointing to and there is no atom there?
> Thank a lot,
> Xinqiang

NIH Center for Macromolecular Modeling and Bioinformatics
Beckman Institute for Advanced Science and Technology
University of Illinois, 405 N. Mathews Ave, Urbana, IL 61801           Phone: 217-244-3349