how excellent! Good job, Rich. Thank you for sharing this.

Just a couple of comments:

The default for Jmol is to render a structure with 100% zoom scaled to
the larger of width and height. When using different dimensions (800
width and 600 height in this case), I recommend you:

1) Use     set zoomLarge false   to ensure that the model at 100% is
fully visible. Not entirely necessary, but I always do this, myself.
2) As you note there, you can generate JPG files at any dimension
regardless of the current Jmol window. Still, I suggest you make your
Jmol window also 800 x 600 so that you have no surprises in the images
created. With the application this can be done by starting Jmol with

  jmol -g 800x600

Also, with that in mind, note that the -j flag on the application now
allows scripting on the command line. So you could get all that on a
command line and create the movies entirely in batch mode. Other
command line flags such as -ion could be of use here. From jmol -h:

 -o,--noconsole               no console -- all output to sysout
 -g,--geometry                window width x height, e.g. -g500x500
 -x,--exit                    exit after script (implicit with -n)
 -i,--silent                  silent startup operation
 -j,--jmolscript              Jmol script to execute
 -n,--nodisplay               no display (and also exit when done)

To combine command-line scripts with file-based scripts, use the -j
flag and include in it ".....;script file1.txt;script file2.txt"

Quotes may be tricky -- use \" with the -j "...." for Jmol commands
that need quotation marks.

Bob


Bob

On Wed, Dec 3, 2008 at 8:26 AM,  <[EMAIL PROTECTED]> wrote:
> 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
>



-- 
Robert M. Hanson
Professor of Chemistry
St. Olaf College
1520 St. Olaf Ave.
Northfield, MN 55057
http://www.stolaf.edu/people/hansonr
phone: 507-786-3107


If nature does not answer first what we want,
it is better to take what answer we get.

-- Josiah Willard Gibbs, Lecture XXX, Monday, February 5, 1900

-------------------------------------------------------------------------
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

Reply via email to