Sign in to follow this  
Maddius

Gun Camera View Identity Matrix

Recommended Posts

Maddius    146
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
feal87    238
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

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

Sign in to follow this