Smoothing camera jitter when walking
Okay here''s my problem. I created a heightmap from a .raw and have it set so my camera follows constantly just a little bit above the ground surface. My problem is, however, that it is incredibly jittery. How would I make the path it follows smoother? I thought about making transitions gradual so it would follow the height transformation over time. But this becomes I big problem when it goes over high surfaces.
Interpolation based on frame rate - this also lets you define how fast you want to go.
Work with actual distances, not just vectors.
Example:
Instead of doing this:
-Move 5 down the Z axis
-Adjust height
Do this:
-Save old position
-Move 5 down the Z axis
-Adjust height
-Save new position
-take vector from old to new position
-Normalize vector
-multiply vector by how much you want the camera to move, 5 in this example
-add vector to old position
This way, when you move up hills it takes into account and limits how much you moved in ALL directions, instead of just shooting up hills. As long as your camera isn''t moving large distances each update, big enough for there to be substantial terrain changes in between the new and old position, it shouldn''t cause any problems hitting terrain. Especailly if your heights are positioned higher than it.
You also want to combine this with Time Based Movement, check www.gametutorials.com for a tutorial on that.
------------
MSN: nmaster42@hotmail.com, AIM: LockePick42, ICQ: 74128155
"It''s all part of the conspiracy of conspirators conspiring to conspire their own conspiracies..."
Example:
Instead of doing this:
-Move 5 down the Z axis
-Adjust height
Do this:
-Save old position
-Move 5 down the Z axis
-Adjust height
-Save new position
-take vector from old to new position
-Normalize vector
-multiply vector by how much you want the camera to move, 5 in this example
-add vector to old position
This way, when you move up hills it takes into account and limits how much you moved in ALL directions, instead of just shooting up hills. As long as your camera isn''t moving large distances each update, big enough for there to be substantial terrain changes in between the new and old position, it shouldn''t cause any problems hitting terrain. Especailly if your heights are positioned higher than it.
You also want to combine this with Time Based Movement, check www.gametutorials.com for a tutorial on that.
------------
MSN: nmaster42@hotmail.com, AIM: LockePick42, ICQ: 74128155
"It''s all part of the conspiracy of conspirators conspiring to conspire their own conspiracies..."
_______________________________________Pixelante Game Studios - Fowl Language
This topic is closed to new replies.
Advertisement
Popular Topics
Advertisement
Recommended Tutorials
Advertisement