Jump to content
  • Advertisement

Archived

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

funkman

Need a little help

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

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
Advertisement
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
Thanks!
Whats the high precision method then? The question was actualy about helicopter simulator. Would it make a difference? as it spins in different directions?

cheers

Share this post


Link to post
Share on other sites

  • Advertisement
×

Important Information

By using GameDev.net, you agree to our community Guidelines, Terms of Use, and Privacy Policy.

GameDev.net is your game development community. Create an account for your GameDev Portfolio and participate in the largest developer community in the games industry.

Sign me up!