Jump to content
  • Advertisement
Sign in to follow this  
Maddius

Gun Camera View Identity Matrix

This topic is 3312 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 all, I have recently added a gun to follow the camera around by setting the view to an identity matrix so that the gun model is constantly close to the camera. However now the lighting model does not take the models movements because it is technically static. Is this the best method for implementing the gun camera? Would there be an easier way? Would I have to reset the view matrix to the cameras view half way through the shader code? I like the idea of using the identity matrix because its simple, but is it viable if I want the lighting to be realistic. Thanks all.

Share this post


Link to post
Share on other sites
Advertisement
Quote:
Original post by Maddius
Hi all,

I have recently added a gun to follow the camera around by setting the view to an identity matrix so that the gun model is constantly close to the camera. However now the lighting model does not take the models movements because it is technically static.

Is this the best method for implementing the gun camera? Would there be an easier way? Would I have to reset the view matrix to the cameras view half way through the shader code? I like the idea of using the identity matrix because its simple, but is it viable if I want the lighting to be realistic.

Thanks all.


I think it is not a good idea if you have to take account of many things like looking up and such. (If you look up with your setup you will still see the gun even thought you shouldn't)
I think you have to set the view matrix of your gun to be the same as the rest of the game and change it each time the user (camera basically) moves.

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!