Jump to content
  • Advertisement


This topic is now archived and is closed to further replies.

Crazy Chicken

D3DXQuaternionSlerp ???

This topic is 5276 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

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

Share this post

Link to post
Share on other sites
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:
//quatNew is the quaternion created by this interpolation
//quatOne is the first quaternion
//quatTwo is the second quaternion
D3DXQuaternionSlerp( &quatNew, &quatOne, &quatTwo, 0.5f );

Dustin Franklin
Mircrosoft DirectX MVP

[edited by - circlesoft on June 7, 2004 12:00:52 AM]

Share this post

Link to post
Share on other sites

  • Advertisement

Important Information

By using GameDev.net, you agree to our community Guidelines, Terms of Use, and Privacy Policy.

We are the game development community.

Whether you are an indie, hobbyist, AAA developer, or just trying to learn, GameDev.net is the place for you to learn, share, and connect with the games industry. Learn more About Us or sign up!

Sign me up!