Skip to main content
gamedev.net
🔒 Locked

Camera Rotation and Program Structure

Started by MannyZanny Aug 23, 2005 at 9:45 PM 0 replies 550+ views
Original Post
MannyZanny
MannyZanny
My first question is it best to rotate the entire scene in order to rotate or rotate the camera using the eye and look. I have gotten the matrix rotation to work and thought it would be better to rotate the camera vectors for eye and look. This worked except for sometimes when I move the camera it goes a little wacko sometimes. The rotation or movement alone worked fine though. I did it by rotating vectors and a little math. Is this the wrong approach? Second is structure for game programming. Should you render by a timer, do physics calculation by a timer, input from the user as they press buttons. Some ways would obviously make a jumping game, what is the correct structure?
circlesoft
circlesoft
Quote:
Original post by MannyZanny
My first question is it best to rotate the entire scene in order to rotate or rotate the camera using the eye and look.

I have always preferred creating a separate camera matrix instead of adding it right into each entity's transformation stack. However, it really goes to the same exact place in the end, so it doesn't matter. D3DX has some cool camera functions that you can use, though.

Quote:
I have gotten the matrix rotation to work and thought it would be better to rotate the camera vectors for eye and look. This worked except for sometimes when I move the camera it goes a little wacko sometimes. The rotation or movement alone worked fine though.

Have you looked at D3DXMatrixLookAtLH()? It's a very easy to use look-at function.

Quote:
Second is structure for game programming. Should you render by a timer, do physics calculation by a timer, input from the user as they press buttons. Some ways would obviously make a jumping game, what is the correct structure?

In a lot of large games, the different core sections of the engine run on different intervals. For example, graphics might run every frame, physics every 25 ms and input every 15 ms. However, for a small application, this is kind of overkill, and you can probably not worry about it.

Topic Locked

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

Sign in to reply to this topic.