From: John Stone (
Date: Tue Nov 11 2003 - 17:40:47 CST

  This is a good idea, and we actually had an initial implementation of this
exact feature implemented for use with the IMD simulations (haptic device,
3-D pointers, etc) but haven't done it in a more releasable form yet.
Paul Grayson had a hacked version of VMD that did the highlighting exactly
as you suggest, but his code never got completed to the point that it
was in a releasable form.

One difficulty in doing a real-time highlight mode is making it
perform well with a large molecule. Doing picking in 3-D requires that
we compare the mouse or other pointer (wand, haptic, etc) position with
that of all "nearby" atoms. The naive implementation of picking just
loops over all atoms and finds the nearest one to the pointer position.
A more refined implementation does a spatial decomposition of the atoms
into a grid first, and then the mouse pointer is mapped to the nearest set
of grid cells, and only the atoms in the grid cells near the mouse pointer
are tested. That's way faster of course. The difficulty with doing this
in real-time is that you have to update the spatial decomposition as
trajectory frames play back, etc. The most difficult case is for IMD,
where there's no possibility of doing lengthy pre-processing since the
data is coming in real-time. For IMD, this turned out to not matter as
much as one would expect because the structures typically consist of only
a few thousand atoms. As you can imagine, doing it for the general case
means that people might use it on structures with 500,000 to 2 million atoms,
so the "naive implementation" is out the window :-)
I've been thinking about what we want to do to enable more
of this sort of real-time picking/highlighting in VMD and there are many
ways I could do it, its just a matter of having the time to attack the
problem. I do appreciate the suggestion, its a good one, and its just
a matter of having time to do it in the right way. If we can resurrect
that code, some may still be in the source tree and accessible by
undocumented commands!..., I'll let you know.


On Tue, Nov 11, 2003 at 11:09:17PM +0100, Marc Baaden wrote:
> Hi again,
> a current "difficulty" when working with tools in VMD (eg a
> phantom in tug mode) is to pick a specific atom. With stereo
> this is sort of feasible, but more often than not one gets the
> atom just next to the one you wanted.
> I wonder whether it would be possible to highlight the atom
> that *would* be selected (eg is nearest to the tool tip, I guess)
> at any given time.
> Something like a yellow sphere for instance ..
> This would certainly be even more helpful when working in mono
> mode.
> I guess that requires some hacking in the VMD source code, but if
> there was another possibility (tcl?) I'd give it a try ..
> Thanks,
> Marc
> --
> Dr. Marc Baaden - Institut de Biologie Physico-Chimique, Paris
> -
> FAX: +49 697912 39550 - Tel: +33 15841 5176 ou +33 609 843217

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