I've implemented some changes to rotate.

First, all the standard stuff is unchanged. You can certainly still do

rotate x 50
rotate z -10

but now there are more options. Prinipal among them:

1) You can address either the "fixed" xyz coordinate system of the Jmol window as these commands do, or you can now rotate around the "internal" model frame (the axes you see when you "set axes on". So, for example:

rotate INTERNAL x 20

rotates the model around its center point about IT's x axis, regardless of how you might have rotated the molecule with respect to the fixed frame.

2) You can specify an atom or set of atoms around which you wish to rotate:

rotate x 20 (atomno=3)

That's a full atom expression -- anything you could select you could put in there. Or:

rotate INTERNAL x 10 (oxygen)

That would be about the geometric centers of all the oxygens on an axis that is parallel to the model's internal x axis.

3) You can include a second atom set; the INTERNAL keyword is now implied and unnecessary:

rotate 30 (atomno=3) (atomno=5)

To complement this, I've added a new picking option: SPIN. So you
can say

set pickingMode SPIN 20

The spin rate, 20 in this case, is optional. 10 is the default. Now when you click on two atoms, the model smoothly rotates around an invisible axis connecting them. Click again, and rotation stops. Click more, and it rotates around whatever atoms you have chosen. Tell me this isn't fun!

4) You can substitute xyz coordinates as [x,y,z] (commas optional, but brackets required. Those are internal coordinates, of course.

rotate 20 [0 0 0] [1 1 1]
rotate 20 x [2 2 0]

5) You can specify a previously drawn object (point, line, or plane) to use for the rotation or in place of an atom set for its center position. Brackets are required.

draw line1 150 (atomno=1) (atomno=14)
rotate [line1] 30

Ends of these drawn lines automatically become rotation initiators, by the way. Click on the end of any drawn line, and the model will rotate. SHIFT-click and it will go clockwise. You can set the rate with

set picking spin 30

6) You can specify an axis and an angle, either FIXED or INTERNAL and rotate around it:

rotate axisangle INTERNAL 20 [1 1 1]

does the same as above, but

rotate axisangle 20 [1 1 1]

rotates in the FIXED frame instead.

7) Finally, I added "-x" "-y" and "-z" just for good measure and also gave rotate some defaults -- y axis at a rate of 10. So you can use:

rotate
rotate 20
rotate -x
rotate -z

A decent test page is at http://www.stolaf.edu/people/hansonr/jmol/test/json/spin.htm

Bob Hanson


--

Robert M. Hanson, [EMAIL PROTECTED], 507-646-3107
Professor of Chemistry, St. Olaf College
1520 St. Olaf Ave., Northfield, MN 55057
mailto:[EMAIL PROTECTED]
http://www.stolaf.edu/people/hansonr

"Imagination is more important than knowledge."  - Albert Einstein



-------------------------------------------------------
This SF.Net email is sponsored by xPML, a groundbreaking scripting language
that extends applications into web and mobile media. Attend the live webcast
and join the prime developer group breaking into this new coding territory!
http://sel.as-us.falkag.net/sel?cmd=lnk&kid=110944&bid=241720&dat=121642
_______________________________________________
Jmol-developers mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/jmol-developers

Reply via email to