Movie Scripts

How to Make a MOLSCRIPT/POVSCRIPT Movie

Here is the script that I stole from someone elses' web site!

It was used to create the figure above (Which is Ang2).

This script requires that you have:

  1. Aligned your molecules inertia axes with x, y, and z (Use moleman2) (Not very necessary if molscript centers it for you).

  2. A molscript input file.

  3. In your working directory a file called header.r3d (See below).



#!/bin/sh
#Parameters
size="300x300"
start=0
stop=359
delta=5 

infile=monomer.mol
#Generate frames
angle=$start
while [ $angle -le $stop  ] ; do
echo "by rotation y " $angle > rotation.file 

outfile=`printf frame-%03d.jpg $angle `
/usr/xtal/povscript_1.5/molscript -r < $infile > ms.rd
cat <<end-floor >> ms.rd
15
6
-.5 -.6 -.5   0 -.7 .5  .5 -.6 -.5    0 0 0
9
15
6
0 0 -1.5    .5 0 -1.5   .5 .5 -1.5   .1 .1 .7
9
end-floor
/usr/local/bin/render -jpeg -size $size< ms.rd > $outfile
angle=`expr $angle + $delta`
done
#Make movie
convert -delay 2 -loop 0 frame-*.jpg movie.gif
#Cleanup -- leave first frame
angle=`expr $angle + $delta`
while [ $angle -le $stop  ] ; do
outfile=`printf frame-%03d.jpg $angle `
rm -f $outfile
angle=`expr $angle + $delta`
done



If you want you can alter the number of degrees that the molecule rotates for each image. This will of course make the file bigger, but will also decrease the appearance of stuttering between images in the movie.



PUT THIS HEADER FILE IN YOUR DIRECTORY:

CALL IT HEADER.R3D

Main light source above for good shadows on floor
     60 60     tiles in x,y
     10 10     pixels (x,y) per tile
     4         anti-aliasing level 4; 3x3->2x2
     1 1 1     background
     T         cast shadows [T/F]
     20        Phong power
     0.25      secondary light contribution
     0.05      ambient light contribution
     0.25      specular reflection component
     2    eye position
    0 1 1.5   main light source position
     1 0 0 0   view matrix describing input coordinate
transformation
     0 1 0 0
     0 0 1 0
     0 0 0 52
     3          mixed objects
     *          (free format triangle and plane descriptors)
     *          (free format sphere descriptors)
     *          (free format cylinder descriptors)