Jmol/Quaternions

From Proteopedia

(Difference between revisions)
Jump to: navigation, search
Line 53: Line 53:
tilted = r * s # rotate the starting orientation to get the tilted orientation
tilted = r * s # rotate the starting orientation to get the tilted orientation
moveto @time quaternion @tilted # tilt the view, taking some time to do so.
moveto @time quaternion @tilted # tilt the view, taking some time to do so.
 +
 +
Choosing x = 1, y = 0.5, z = 0 and tilt = 10, the buttons illustrate the commands.
 +
<jmol><jmolButton><script>s = quaternion(); r = quaternion({1 0.5 0},10); tilted = r * s; moveto 1 quaternion @tilted </script><text>tilt 10 degrees away from view</text></jmolButton></jmol>
 +
 +
<jmol><jmolButton><script>moveto 1 quaternion @s </script><text>back to last orientation</text></jmolButton></jmol>
 +
 +
Choosing x = 1, y = -0.5, z = 0 and tilt = 10, the buttons illustrate tilting in a different direction.
 +
<jmol><jmolButton><script>r = quaternion({1 0.5 0},10); tilted = r * s; moveto 1 quaternion @tilted </script><text>tilt 10 degrees away from view in another direction</text></jmolButton></jmol>
 +
 +
<jmol><jmolButton><script>moveto 1 quaternion @s </script><text>back to last orientation</text></jmolButton></jmol>
 +
 +
 +
==Interpolating between orientations==
==Interpolating between orientations==

Revision as of 16:36, 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