Introduction

This is some basic information by Barry Isralewitz detailing how to make movies using VMD. Best to read them both before starting, since the second expands on something in the first. I'll try to clean this up sometime.
The instructions are optimized for making MPEG movies for Powerpoint, using the programs readily available here in the TB group. There are lots of other ways to approach this, this method works pretty reliably for me. iuc.edu)

The first description:


(usage note: Below, I put the filenames for the full rotation
in [brackets], the filenames for the slow 20 degree back-and-forth
rotation are without brackets.)

        Making rotation animations
        --------------------------

In vmd, I load the traj with a file like:

/Home/g1/barryi/projects/for-ana/wiggle5.vmd

moved it to a nice orientation, then generated the frames (render
snapshot, adjusted window manually to 640x480) with this:

 /Home/g1/barryi/projects/for-ana/rot-wig-deg-long-slow.tcl
[  /Home/g1/barryi/projects/for-ana/rotate-wig-lh2.tcl ]


I found that incrementing through the trajectory at 30 fps just gives
a blur of moving parts.  The camera movements / rotations look great
at 30fps, but the MD trajectory increment itself (at least for this
traj) should happen more rarely (every 2nd or 4th animation frame for
example)


Then, convert to tif (I used cancun.ks) with:

/Home/g1/barryi/projects/for-ana/convert-deg-long-slow.pl 
[ file:/Home/g1/barryi/projects/for-ana/convert-full-rot.pl  ]

and then use IRIX-sgi's mediaconvert.  The tifs are 320 by 240, so just set
for mpeg-1, SIF size, preserve aspect, and start the conversion.


        Note that here I went from 640x480 -> 320x240, this gave a
nice anti-alias to the 320x240 frames, thanks to convert's default
anti-aliasing feature for resizing.

        Note also that in the tcl script the only interesting thing is
keeping a single method of generating the frame numbers.  So that when
a script needs to do 2 or more camera moves, its easy just to add
another loop to the script, and frames keep their sequential numbering
with no effort.  This leads to big savings when you want to "do the
whole thing again, but a bit to the left". 
        
        Note finally that the perl scripts zero-fill in a less
amateurish way than the tcl scripts, but, hey, if it ain't broke...

The second Email:

Hi,

In the mail I sent each of you recently about the scripts I used to
animate lh2 for ana, I should have noted the following:

For animations that are intended to loop (i.e.  360 degree turns,
rocking motions, etc.) make sure that the last frame smoothly
transitions into the first frame. 

In the case of the mpg movie of lh2 for ana with "full-rotation", the
final frame is late in the trajectory, and far displaced in
configuration from the first frame.  So even though the final frame of
the trajectory is at (say) 359 degrees, when the first frame is shown
during looping, at = (=360) degrees rotation, there is a jump in
configuration.

	One way to deal with this, just have your animation set
advance at the right ration so that the trajectory you intend to show
completes an integral number of times, then loop backwards through the
same trajectory.

	 See /Home/g1/barryi/projects/for-ana/rot-wig-20degslow.tcl
for an example of "once through trajectory" for a rock.

	 If rocking, you can choose one extent of the rock as the
midpoint, then just render the frames into your mpeg ordered
backwards, if you want to save on rendering time.



 But, you might object, how can I do this If I don't want to change my
rotation (or zoom) speed nor change my number of frames (i.e. length
of the 30 fps animation)?  An answer is to use fmod
(floating-point-modulo), so that you can, for example, have a 1 or 2
frame interval between your traj advances, to average, say, a 1.44 interval
between traj. frame advances.  You can then simultaneously decide on:
animation length and camera move (rotation, zoom, etc) speed w
and still have a smooth trajectory transition at looping.

	Here's an example in (not-quote-tested) tcl, it will advance
through 206 frames of trajectory while generating 300 frames of
animation frames, you can replace the "($firstframenum - $framenum)"
stuff with whatever you are using for animation frame number.  Only
the 'set traj_inc" and 'if' statements are relevant to my point, the
rest is for context...

====

set traj_inc [expr 300.0/208]
# the ".0" to force floating point divide

{
#Loop over you animation frames, at every iteration....

#  We check for fmod < 1 since we always increment framenum by 1, works for int  
#or non-int traj_inc
	if {  fmod ( ($firstframenum - $framenum),  $traj_inc  < 1.0 ) }  {

        	animate next
	}
# increment your animate frame number and write it however you like

}


#Then set frame to final traj. frame (just to make sure not off-by-one)

# And now repeat with animate prev..
{
#Loop over you animation frames, at every iteration....


	if {  fmod ( ($firstframenum - $framenum),  $traj_inc  < 1.0 ) }  {

		animate prev
	
	}
# increment your animate frame number and write it however you like

}