Platform SDK: DirectX

D3DXQuaternionExp

The D3DXQuaternionExp function calculates the exponential

D3DXQUATERNION* D3DXQuaternionExp(
  D3DXQUATERNION* pOut,
  const D3DXQUATERNION* pQ
); 

Parameters

pOut
A pointer to the D3DXQUATERNION structure that is the result of the operation.
pQ
A pointer to the source D3DXQUATERNION structure.

Return Values

A pointer to a D3DXQUATERNION structure that is the exponential.

Remarks

The D3DXQuaternionExp function only works with pure quaternions, where w == 0.

This function is implemented in the following manner:

q = (0, theta * v)

exp(q) = (cos(theta), sin(theta) * v)

The D3DXQuaternionExp and D3DXQuaternionLn functions are useful when using the D3DXQuaternionSquad function. Given a set of quaternion keys (q0, q1, q2, ..., qn), you can compute the inner quadrangle points (a1, a2, a3, ..., an-1) as follows, in order to insure that the tangents are continuous across adjacent segments:

        a1    a2    a3
  q0    q1    q2    q3    q4
 
a[i] = q[i] * exp( -(ln(inv(q[i])*q[i+1]) + ln(inv(q[i])*q[i-1])) / 4 )

Once (a1, a2, a3, ...) are computed, you can use the results to interpolate along the curve:

qt = Squad(t, q[i], a[i], a[i+1], q[i+1])

The return value for this function is the same value returned in the pOut parameter. In this way, the D3DXQuaternionExp function can be used as a parameter for another function.

Requirements

  Windows NT/2000: Requires Windows 2000.
  Windows 95/98: Requires Windows 95 or later. Available as a redistributable for Windows 95.
  Version: Requires DirectX 7.0.
  Header: Declared in d3dxmath.h.
  Library: Use d3dx.lib.

See Also

D3DXQuaternionLn, D3DXQuaternionSquad