Frequently
Asked Questions

**What interpolation schemes do I need to implement?**

** **

**Catmull-Rom or Bezier for Euler angles****Catmull-Rom or Bezier for Quaternion angle representation****Spherical Linear Interpolation for Quaternion angle representation**

** **

**The matrix given in Shoemake paper for converting from Quaternion to Matrix has different signs than the matrix given in the Parent book (page 452).**

** **

**If you use matrix from Shoemake
paper you have to be careful as it represents rotation by q ^{-1} rather
than q and because of that some signs are reversed (the paper defines rotation
by quaternion as v’ = q^{-1}*v*q).**

** **

**How to convert from Matrix to Euler angles?**

** **

Use the formulas on pages (253, 254) of Shoemake paper to compute sin and cos for all angles.

**Then
use atan2 function to compute the angles:**

** **

** m_real x = atan2( sinx, cosx );**

** m_real y = atan2( siny, cosy );**

** m_real z = atan2( sinz, cosz );**

** **

**How do I compute a**_{n}and b_{n }control points for Bezier curve using quaternion angle representation? The book only explains it for Euclidian space.

** **

All the formulas for computing a_{n} and b_{n}
using quaternion representation are given in Shoemake paper (page 249).

**Bezier for Quaternions does not work correctly. May be the formulas in the Paper are incorrect?**

** **

The formulas are correct. We implemented the algorithm using the formulas in the paper and it works.

** **

**Couple
of things to make sure:**

**Make sure you read paragraph 4.4 on page 250 in Shoemake paper. When you compute a**_{n}, you can control the quality of the interpolation by brining a_{n }closer to q_{n. }The good value is to set (a_{n }, q_{n})_{ }segment to 1/3 of the original length. This point is also discussed in Parent book (page 100, third paragraph).**In Double(p, q) = 2(p*q)q – p, p*q is a dot product.**

**Is the conversion from Euler angles to quaternions in Shoemake paper correct?**

** **

Yes. It is correct. I implemented it. Below is my implementation. It exactly follows formulas in the paper.

** **

**quater
EulerAngle2Quater( vector const& v )**

**{**

** quater q;**

** **

** float cosX = cos(v.x()/2.0);**

** float cosY = cos(v.y()/2.0);**

** float cosZ = cos(v.z()/2.0);**

** **

** float sinX = sin(v.x()/2.0);**

** float sinY = sin(v.y()/2.0);**

** float sinZ = sin(v.z()/2.0);**

** **

** q.set_w(cosX*cosY*cosZ +
sinX*sinY*sinZ);**

** q.set_x(sinX*cosY*cosZ -
cosX*sinY*sinZ);**

** q.set_y(cosX*sinY*cosZ +
sinX*cosY*sinZ);**

** q.set_z(cosX*cosY*sinZ -
sinX*sinY*cosZ);**

** **

** return q;**

**}**

** **

** **

** **