Jmol/Quaternions

From Proteopedia

(Difference between revisions)
Jump to: navigation, search
Line 110: Line 110:
moveto @duration quaternion @q1 # reorient the view back to q1 in duration seconds
moveto @duration quaternion @q1 # reorient the view back to q1 in duration seconds
 +
==Moveto vs Rotate command==
 +
The rotate command only rotates (no zoom or translation), and always at the same speed. If you want to have control over the rotation speed, you have to use moveto instead. Moveto takes the final orientation as a parameter, and moves to it from whatever the current orientation is. On the other hand, the rotate command is relative to the starting orientation. If you want to turn a rotate command into a moveto command, you have to calculate the final orientation in the following way:
 +
start = quaternion();
 +
final = rotation * start; #equation 1
 +
 +
Then, you can use the moveto command.
 +
 +
On the flip side, if you have the final and start orientations, and need the rotation, you use quaternion division:
 +
 +
rotation = final / start; #equation 2
 +
 +
Equation 2 is derived by right-dividing equation 1 by start to isolate rotation on the right hand side
 +
 +
 +
==Moving atoms==
 +
some other time...
</StructureSection>
</StructureSection>
==Resources==
==Resources==
http://sacredsoftware.net/tutorials/quaternion.html
http://sacredsoftware.net/tutorials/quaternion.html

Revision as of 18:34, 25 July 2019

Drag the structure with the mouse to rotate

Resources

http://sacredsoftware.net/tutorials/quaternion.html

Proteopedia Page Contributors and Editors (what is this?)

Karsten Theis

Personal tools