From: Axel Kohlmeyer (akohlmey_at_gmail.com)
Date: Wed Sep 07 2011 - 10:35:43 CDT

On Wed, 2011-09-07 at 15:30 +0200, Filip Persson wrote:
> Hello,

> Is it possible to draw the intersection volume (i.e the "overlap
> volume") between two spheres in VMD? Could one use Boolean expressions

no.

> to do this, something like "draw sphere {x1 y1 z1} AND sphere {x2 y2
> z2}"?

no. you'd need to construct those as triangular meshes.

> I also want the spheres to be centered on specific atoms in my
> trajectory - how do I update the center position of a sphere in every
> frame? I tried using

why don't you just add a (second) VDW representation
with a different material, color and a different
radius scaling factor?
generally, to hook something into the animation
loop, you need to use what is called a variable trace.
there should be a couple of examples in the VMD user's
manual, if i remember correctly.

>
> set atomX [atomselect top "index X"]
> set pos [$atomX get {x y z}]
> draw sphere $pos radius 3 resolution 10
>
>
> for every new frame, but I get the error "need three numbers for a
> vector".

that is because atomselect returns a _list_ of lists,
since you may have more than one atom in the selection.

try:

set pos [lindex [$atomX get {x y z}] 0]

axel.

>
>
> I really appreciate your help!
>
>
> Best,
> FIlip
>
>
>
>

-- 
Dr. Axel Kohlmeyer
akohlmey_at_gmail.com http://goo.gl/1wk0
Institute for Computational Molecular Science
Temple University, Philadelphia PA, USA.