Jump to content
  • Advertisement
Sign in to follow this  
colinisinhere

Attatching viewmodel to camera

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

My Camera class is basicly the same as Gametutorials.com except for some minor changes... and I need to know how to rotate a model the same as the camera, for an FPS... thanks!

Share this post


Link to post
Share on other sites
Advertisement
Guest Anonymous Poster
In FPS you can rotate freely around the world Y axis and with in a 180 degree arc around the cameras x axis. Its really very simple. When you push the mouse left or right you use the Y axis to rotate around, make sure to rotate every thing opposite since this is the camera you are rotating. And when you push the mouse up and down use the cameras x axis, again make sure to rotate everything by the reverse. The only difference here is to make sure check the angle doesn’t go above 90 or below -90. You can use the vector dot product between the world y axis and the cameras z axis to determine the angle.

Share this post


Link to post
Share on other sites
i am using a system like this: in render function load the identity matrix and render you model or make the models render before camera movements. works well..

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!