With Bob's implementation of quaternions in Jmol it is *extremely* easy to
let Jmol create an image sequence between two user-defined views. This
sequence can then be converted into a movie using the standard tools. I
did this recently (with Bob's help to get the syntax right) using the
application and was pleasantly surprised at how well it worked.
The steps are simple. In a text editor make two scripts, the first
("settings.txt") will be the settings you want, e.g. axes off, unitcell
off, spacefill..., etc.
and the second will have the commands to create the image sequence
("make_movie.txt") which I go into detail about below:
In the Jmol application:
1) load a molecule and open the script window and enter
script settings.txt
to setup Jmol and your molecule to taste
2) move the molecule to the first view and in the script window enter
q1 = script("show rotation")
3) move the molecule to the final view and in the script window enter
q2 = script("show rotation")
4) now reset Jmol and return to the first view with these commands
reset; script settings.txt; rotate quaternion @q1
5) now start the make_movie script with
script make_movie.txt
and Jmol will start writing the images
In the make_movie.txt script are these commands:
# define the number of images to create in the variable num_frames
# for a 15 fps video lasting 30 sec we need 450 images
var num_frames = 450
# assuming the two quaternions defining the views are q1 and q1 then
# the fraction the model must be moved for each frame to get from
# view q1 to view q2 is q2/q1/num_frames, define this as dq
var dq = q2/q1/num_frames
# now use a loop to create the images writing to a filename created
# on the fly with a sequence id (using PNG files in this example)
for (var i = 0; i <= num_frames; i = i+1)
var filename = "movie"+("000"+i)[-2][0]+".png"
write IMAGE 800 600 PNG @filename
rotate quaternion @dq
end for
--Rich
-------------------------------------------------------------------------
This SF.Net email is sponsored by the Moblin Your Move Developer's challenge
Build the coolest Linux based applications with Moblin SDK & win great prizes
Grand prize is a trip for two to an Open Source event anywhere in the world
http://moblin-contest.org/redirect.php?banner_id=100&url=/
_______________________________________________
Jmol-users mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/jmol-users