Jump to content
  • Advertisement
Sign in to follow this  
magneeto

how to rotate a camera??

This topic is 4432 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, how can i rotate a camera in a scene? there are rotation matrices to rotate objects/points. but i don't see any matrices to use to rotate the camera. i want to use a mouse so that while i drag the mouse the camera will move. how do i do this??

Share this post


Link to post
Share on other sites
Advertisement
Quote:
Original post by magneeto
how can i rotate a camera in a scene? there are rotation matrices to rotate objects/points. but i don't see any matrices to use to rotate the camera. i want to use a mouse so that while i drag the mouse the camera will move. how do i do this??


You don't rotate the camera - it never actually moves. Instead, you rotate everything else in the opposite direction. So the rotation matrices used to rotate objects and points are what you want.

Share this post


Link to post
Share on other sites
actually i want to simulate a camera in the scene. i want to move the camera left when i drag the mouse right or up when i drag the mouse down the y axis. i'm having difficulties calculating the new position of the camera in the opposite direction of the mouse movement. using glRotate() does not seem to work appropriately. is it possible that i can send the source code so that u could have a look of what i am talking about. thank u for your reply.

magneeto

Share this post


Link to post
Share on other sites
Sign in to follow this  

  • Advertisement
×

Important Information

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

We are the game development community.

Whether you are an indie, hobbyist, AAA developer, or just trying to learn, GameDev.net is the place for you to learn, share, and connect with the games industry. Learn more About Us or sign up!

Sign me up!