# Camera Rotation and Program Structure

This topic is 4900 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

## Recommended Posts

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?

##### Share on other sites
Quote:
 Original post by MannyZannyMy 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.

• ### What is your GameDev Story?

In 2019 we are celebrating 20 years of GameDev.net! Share your GameDev Story with us.

• 15
• 9
• 11
• 9
• 9
• ### Forum Statistics

• Total Topics
634134
• Total Posts
3015743
×