how do racing games typically angle cameras to look as nice as they do when turning? How do they make it look natural and gradual, yet still functional?

973 views

how do racing games typically angle cameras to look as nice as they do when turning? How do they make it look natural and gradual, yet still functional?

In: Mathematics

10 Answers

Anonymous 0 Comments

The simplest way of doing it is measuring the angle between the camera and the vehicle’s longitudinal axis and using that to control the rate at which the camera rotates around the vehicle’s center point.

As the angle increases, so does the rate at which the camera rotates, until it matches the rate at which the vehicle rotates. At that point, the angle will no longer increase, but the camera will be offset to the side because it lags behind whenever its rate of rotation is less than the vehicle’s rate of rotation. And when you stop turning, the camera will keep turning but as the angle decreases, the camera’s rate of rotation will also decrease, reaching zero when the camera is centered.

You can also control the maximum offset angle by using a different equation for the rate of rotation. Any arbitrary equation will do as long the input is the angle and the output is the rate of rotation. The example I described above is simply [rate of rotation] = [angle]. But you could just as easily do [rate of rotation] = 0.025 * [angle], or you could do silly stuff like [rate of rotation] = e^(cos([angle])) that’ll probably make you nauseous when you try to play the game.

But of course, nothing’s keeping you from also including other variables like the vehicle’s speed, or whether you’re using your TurboNitroSuperBoost or whatever.

You are viewing 1 out of 10 answers, click here to view all answers.