Difference between revisions of "User:DavidJCobb"

From the CreationKit Wiki
Jump to navigation Jump to search
imported>DavidJCobb
imported>DavidJCobb
(added sources)
Line 1: Line 1:
I'm working on a Papyrus library for working with rotations. For now, this is my scratchpad.
I'm working on a Papyrus library for working with rotations. For now, this is my scratchpad.
= Scratchpad =
== Rotation resources ==
[http://www.vectoralgebra.info/eulermatrix.html This page] generates forumlae to convert from Euler angles (in any convention) to rotation matrices.
[http://www.vectoralgebra.info/axisangle.html This page] and [http://www.vectoralgebra.info/euleranglesvector.html this page] together offer the information needed to convert from Euler angles (in any convention) to an axis-angle representation.
The process of converting from axis angle to quaternion (and vice versa) is one of the few rotation-related operations that [https://en.wikipedia.org/w/index.php?title=Axis%E2%80%93angle_representation&oldid=608157500#Unit_quaternions Wikipedia explains in plain English]. Ten bucks says a pack of PhDs will eventually come along and rewrite the article into gibberish, so that's a link to an archived version of the article as it existed when I found it.


== Converting any Euler sequence to a rotation matrix ==
== Converting any Euler sequence to a rotation matrix ==

Revision as of 13:06, 9 August 2014

I'm working on a Papyrus library for working with rotations. For now, this is my scratchpad.

Scratchpad

Rotation resources

This page generates forumlae to convert from Euler angles (in any convention) to rotation matrices.

This page and this page together offer the information needed to convert from Euler angles (in any convention) to an axis-angle representation.

The process of converting from axis angle to quaternion (and vice versa) is one of the few rotation-related operations that Wikipedia explains in plain English. Ten bucks says a pack of PhDs will eventually come along and rewrite the article into gibberish, so that's a link to an archived version of the article as it existed when I found it.


Converting any Euler sequence to a rotation matrix

Source: https://web.archive.org/web/20110721191940/http://cgafaq.info/wiki/Euler_angles_from_matrix

Corrected (Wikipedia-compatible) versions of that site's LaTeX are as follows:

"Symmetries" equation 1

  P = \begin{bmatrix} 0&1&0\\0&0&1\\1&0&0 \end{bmatrix}

"Symmetries" equation 2

  P = \begin{bmatrix} 0&0&1\\0&1&0\\1&0&0 \end{bmatrix}

"First merger" equation 1

\begin{align} {\mathrm rot}({\mathbf{xzy}_s},\theta_x,\theta_z,\theta_y) &= {\mathrm rot}(y,\theta_y)\,{\mathrm rot}(z,\theta_z)\,{\mathrm rot}(x,\theta_x) \\ &= \begin{bmatrix} c_y c_z & s_y s_x - c_y s_z c_x & s_y c_x + c_y s_z s_x \\ s_z & c_z c_x & -c_z s_x \\ -s_y c_z & c_y s_x + s_y s_z c_x & c_y c_x - s_y s_z s_x \end{bmatrix} \end{align}

"First merger" equation 2

\begin{align} {\mathrm rot}({\mathbf{xzx}_s},\theta_x,\theta_z,\theta_{x'}) &= {\mathrm rot}(x,\theta_{x'})\,{\mathrm rot}(z,\theta_z)\,{\mathrm rot}(x,\theta_x) \\ &= \begin{bmatrix} c_z & -s_z c_x & s_z s_x \\ c_{x'} s_z & c_{x'} c_z c_x - s_{x'} s_x & -s_{x'} c_x - c_{x'} c_z s_x \\ s_{x'} s_z & s_{x'} c_z c_x + c_{x'} s_x & c_{x'} c_x - s_{x'} c_z s_x \end{bmatrix} \end{align}

"First merger" equation 3

{\mathrm rot}(z,\theta_z)\,{\mathrm rot}(x,\theta_x) = \begin{bmatrix} c_z & -s_z c_x & s_z s_x \\ s_z & c_z c_x & -c_z s_x \\ 0 & s_x & c_x \end{bmatrix}