Jump to content
  • Advertisement
Sign in to follow this  

Animating Camera

This topic is 4457 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 have an camera that follows my character such as third person cams. When the character turns left or right, the camera turns same as the character. But this turning or rotating is sharply. I want to rotate the camera smoothly. When the character's direction changed, I set the charecter's direction to the camera's direction. So, rotating of the camera is sharply. How can I do a smooth camera animation in this perform?

Share this post

Link to post
Share on other sites
lets see, something like this

vector endPos // postion that you want it to move to
float endRot // rotation you want it to end at
float movespeed // speed to translate
float deltaTime // time since last update/frame

vector currPos // postion of camera
float currRot // rotation of camera

vector diffPos = endPos - currPos // difference of positions
float diffRot = endRot - currRot // difference of rotations

// the tween
currPos = currPos + diffPos * moveSpeed * deltaTime;
currRot = currRot + diffRot * moveSpeed * deltaTime;

that should work or be a start..
try a google Tweening... Linear...Easing..Quadratic..

Share this post

Link to post
Share on other sites
Sign in to follow this  

  • Advertisement

Important Information

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

Participate in the game development conversation and more when you create an account on GameDev.net!

Sign me up!