Skip to main content
GameDev.net gamedev.net
🔒 Locked

Eliminating Camera Jitter

Started by tscott1213 Nov 7, 2005 at 12:54 PM 2 replies 1.7k views
Original Post
tscott1213
tscott1213
Hey all, I have a 3rd person camera that is tracking an object. The camera update simply gets the tracked object's new position and sets the camera to that new position. The problem I am having is if the object being tracked begins to shake or have some jitter to it (which is perfectly reasonable in my case) then I would like the camera to continue to track the object without shaking around the whole screen. I am sure this has been done, but my searches haven't turned up anything useful. Can anyone point me in the direction of a good resource for dealing with this? Thanks Todd
bzroom
bzroom


In your camera class instead of directly setting the camera to the new position, provide an accumulator so that you only move camera once the object has moved X distance. Just set your X distance to be slightly greater the jitter you get (I assume it comes from your physics system). And then dont directly move to that point and reset your accumulator, accelerate towards it and decelerate aproaching it. This should give you ideal results.
Daniel Miller
Daniel Miller
Give your camera inertia, so that it's difficult to shake or move too quickly.
tscott1213
tscott1213
Thanks guys...

honayboyz - I tried something like that but the camera would end up jumping small distances back and forth. The jitter isn't constant, so the object jitters its way left then jitters its way right. So, the camera ends up jumping left and right, just slighlty larger distances then before.

Daniel - That sounds interesting...I'm going to give that a shot.

Thanks

Topic Locked

This topic has been locked by a moderator. New replies are not allowed.

Sign in to reply to this topic.