Difference between revisions of "Creating Movies"

From Jmol
Jump to navigation Jump to search
 
m (Creating movies moved to Creating Movies: consistent naming)
(No difference)

Revision as of 10:36, 12 September 2007

Jmol / JSmol Tutorials


What you need

An animation is just a sequence of images, so all one needs is jmol to create a batch file of images. There is currently no menu option to do this, but a small bit of scripting can do the trick. It is possible to get the movie output from either one frame at several angles or from a series of frames.

The main part of the script is given here: based on a mail from Bob Hanson on the mailing list.

name = "./frame0000.jpg";
nFrames = 125;
nDegrees = 1;
thisFrame = 0;
width = 640;
height = 480;

set zoomLarge false;

message loop;
thisFrame = thisFrame + 1;
fileName = name.replace("0000","" + ("0000" + thisFrame)[-4][0]);
#rotate x @nDegrees;
#rotate y @nDegrees;
#rotate z @nDegrees;
frame next;
refresh;
write image @width @height @fileName;
if (thisFrame < nFrames);goto loop;endif;
background black;

Save this text in a file, for example movieloop.jmol. Now you still need to load

Exporting from a multiframe XYZ file

peichern 1. xyz datei öffnen, ansicht anpassen 2. jmol console 'script' starten, da 'write state "formovie.state" ' ausführen. 3. cat formovie.state movie.jmol > domovie.jmol 4. dann 'jmol domovie.jmol' ausführen, 5. convert *.jpg out.gif