D3DXQuaternionSlerp ???
Hi I am currently working on my 3rd person camera for my game.
I am especially keen to get my camera to rotate smoothly using
quaternion interpolation.
Can someone please explain the "D3DXQuaternionSlerp" function to me and how I would have to use it to rotate between two orientations.
msdn link:
http://msdn.microsoft.com/archive/default.asp?url=/archive/en-us/directx9_c/directx/graphics/reference/d3dx/functions/math/d3dxquaternionslerp.asp
Thanks !!!!
Luke
All D3DXQuaternionSlerp does is interpolate between two quaternions, based on a timestep value you give it. This timestep should be between 0.0f and 1.0f, and the closer you get to 1.0, the closer the resulting quaternion is to the 2nd quaternion. Here is a sample:
Dustin Franklin
Mircrosoft DirectX MVP
[edited by - circlesoft on June 7, 2004 12:00:52 AM]
//quatNew is the quaternion created by this interpolation//quatOne is the first quaternion//quatTwo is the second quaternionD3DXQuaternionSlerp( &quatNew, &quatOne, &quatTwo, 0.5f );
Dustin Franklin
Mircrosoft DirectX MVP
[edited by - circlesoft on June 7, 2004 12:00:52 AM]
This topic is closed to new replies.
Advertisement
Popular Topics
Advertisement