Sign in to follow this  
fatihtolgaata

Animating Camera

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

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

Sign in to follow this