Jump to content
  • Advertisement
Sign in to follow this  
brekehan

Camera Rotation is Chunky

This topic is 3412 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

When I rotate the camera, even if I do it slowly, it looks a little chunky. It gives me a headache after awhile. I know the problem is from trying to rotate the camera at a angle, around an axis in object space, based on the time it took for the last frame update. Since it is incrementally rotating, the camera it looks incremental. I just can't come up with a way to fix it. If the camera was constantly rotating then I could use a total time and some flavor of slerp, instead of a last frame time, but its not! It has to rotate when the user presses a key and stop when the user releases a key. Then rotate at an angle around a new axis in object space when the user presses another key. I use the classic keystates array and check them every frame. If the key is down, then rotate by an angle * lastFrameTime. Since, it is a flight style camera, I want the rotations to be in object space. i.e. Left arrow should rotate left from where you are looking. How can I get smoother camera transforms?

Share this post


Link to post
Share on other sites
Advertisement
What do you mean "chunky"? Do you mean it doesn't rotate smoothly?
If so, are you averaging out the last few frames? If not, you'll find that the frame times vary so much that the camera jerks around.

Share this post


Link to post
Share on other sites
I am averaging the last 5 and it looks better now.
Not sure if 5 is a good number or not, I just picked it out of a hat.

Share this post


Link to post
Share on other sites
Quote:
Original post by brekehan
I am averaging the last 5 and it looks better now.
Not sure if 5 is a good number or not, I just picked it out of a hat.
It depends how variable your frame rate is. Trial and error is key really; just set it to whatever looks reasonable. Personally I find that between 2 and 15 works well.
Longer averaging durations will smooth out spikes more, but will be less accurate.

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.

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!