Note that there are some explanatory texts on larger screens.

plurals
  1. POWPF 3D: How to convert a single AxisAngleRotation3D into separate AxisAngleRotation3D?
    text
    copied!<p>I have a 3D viewport that uses the TrackBall of WPF 3D tool to rotate the object by mouse. As a result, I get a single AxisAngleRotation3D with Axis vector like (0.5, 0.2, 0.6) and Angle of e.g. 35. That's fine.</p> <p>What I would like to do is, as an alternative, to give user the ability to rotate the object by individual axis (i.e. x, y, z). So, if the object is rotated around the axis of (0.5, 0.2, 0.6) by 35 degree, how can I convert this into three rotations around each axis, ie. Xangle for vector (1, 0, 0), Yangle for vector (0, 1, 0), and Zangle for vector (0, 0, 1). </p> <p>I also need a way to convert them back to a single AxisAngleRotation3D object.</p> <p><strong>EDIT</strong>:</p> <p>I found some stuff at <a href="http://www.gamedev.net/reference/articles/article1095.asp" rel="nofollow noreferrer">http://www.gamedev.net/reference/articles/article1095.asp</a>. One thing I learnt is that I can easily get a (combined) quaternion from separete AxisAngleRotation3D. For example,</p> <pre><code> private AxisAngleRotation3D _axisX = new AxisAngleRotation3D(); private AxisAngleRotation3D _axisY = new AxisAngleRotation3D(); private AxisAngleRotation3D _axisZ = new AxisAngleRotation3D(); ... _axisX.Axis = new Vector3D(1, 0, 0); _axisY.Axis = new Vector3D(0, 1, 0); _axisZ.Axis = new Vector3D(0, 0, 1); ... Quaternion qx = new Quaternion(_axisX.Axis, _axisX.Angle); Quaternion qy = new Quaternion(_axisY.Axis, _axisY.Angle); Quaternion qz = new Quaternion(_axisZ.Axis, _axisZ.Angle); Quaternion q = qx * qy * qz; </code></pre> <p>This is fine. Now, the problem is how can I do the reverse? So, for a given q, how can I find out qx, qy, qz?</p>
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload