Archived

This topic is now archived and is closed to further replies.

funkman

Need a little help

Recommended Posts

Hi guys im very new to the forum but have been reading gamedev for quite a while. Im doing MSc in Games technology in Scotland. Im currently revising for Games Programming exam and have a question I need some help with. Problem: There is a spinning camera in the centre of the empty room. In one corner there are loads of objects. Obviously the camera will slow down on this corner. So rendering must be managed so it spins with same speed. What needs to be done? (answer is not a fixed angular increment?) Any ideas? will appreciate any answer. Thanks

Share this post


Link to post
Share on other sites
This is a simple question of how to keep movement of anything constant for changing framerates. There is a high precision method for this, and a low precision method.

The low precision method is as good as you need for something that has a constant movement (or angular as in this case) velocity. All you do is each frame you test to see how long the frame took. You need to learn timing for this. Set your camera''s angular velocity to whatever you want, and determine what units the velocity will be in. For example, let''s say that I make my camera''s velocity be in radians/second. Then say I set the velocity to 1.

In the code, I''d do something like this:

cameraRotationY += cameraRotationVelocityY * difference/1000.0f;

Basic. If you have a slower framerate, the difference will be greater, and the camera will move more that frame.

--Vic--

Share this post


Link to post
Share on other sites