From: Josh Vermaas (
Date: Wed Dec 09 2020 - 10:54:39 CST

Hi Demetrius,

The way I'd do this is actually a bit sneaky. It looks like you are
starting from a final (crystal?) structure, and want to move elements away
from one another, and then reverse the movie that gets generated so that it
looks like the elements are coming together. I'd do something like this:

#Ref would be the selection in the middle.
set ref [atomselect top "sometext here"]
#each selection here would be one chain you want to move
set sel1 [atomselect top "selection text 1"]
set sel2 [atomselect top "selection text 2"]
#repeat as needed.

#Render the initial positions. This will end up becoming your last frame in
the final animation.
render Snapshot [format "frame.%04d.ppm" 0]
for { set i 1 } { $i < 100 } { incr i } {
#move each selection by a normalized vector, pointed in the direction of
the center of the selection minus the center of the reference.
$sel1 moveby [vecnorm [vecsub [measure center $sel1] [measure center $ref]]]
$sel2 moveby [vecnorm [vecsub [measure center $sel2] [measure center $ref]]]
render Snapshot [format "frame.%04d.ppm" $i]

This will get you the intermediate frames you are looking for. Some
additional notes: you can make the motions finer with a "vecscale" command.
vecnorm will get you vectors of length 1. I'd also encourage you to look at
nicer rendering options than "snapshot". The render list command will list
them for you. It is all in the userguide: (look under tcl commands).


On Tue, Dec 8, 2020 at 7:32 PM Demy Hernandez <>

> Thank you for your response Josh,
> I have attached two example videos of the movement I am looking for. I am
> specifically looking for similar molecule movement as seen in testMove.mp4,
> but more importantly where both molecules move together to their final
> resting places.
> I run into problems specifically when I am trying to get certain molecules
> to stay in place and certain molecules to move. Also what are some other
> possibilities to create movies like these?
> Respectfully,
> Demetrius
> On Tue, Dec 8, 2020 at 7:00 PM Josh Vermaas <>
> wrote:
>> Hi Demetrius,
>> Do you have an example from others that highlights what you want to do?
>> I'm not sure I understand what you mean by several molecules moving in
>> different directions. Fundamentally, animations are just a series of still
>> images. The movie maker and VCR tools are one way of orchestrating the
>> production process, but aren't the only possibilities.
>> -Josh
>> On Tue, Dec 8, 2020 at 6:02 PM Demy Hernandez <>
>> wrote:
>>> Hello VMD Community,
>>> I am attempting to create a movie in VMD where it appears that several
>>> molecules are moving in different directions at the same time. I am having
>>> trouble accomplishing this, I am using the built in Movie Maker and
>>> ViewChangeRender tools.
>>> Is there any way to do this?
>>> Respectfully,
>>> Demetrius