What I’m trying to do is draw a gun for a fps game I am making but it always seems to be off. I know I am supposed to draw it last with depth test disabled. But i just can’t seem to get it to follow along with the view of the camera. Assume we are just drawing a triangle to represent the gun right now, with the base being at the players end. I have access to player position and the point where he is looking (used for gluLookAt) and I also have access pitch and yaw. And ideas on what to do?
Share
I’m not an expert but I would try something akin to the following for drawing the gun:
The best guide I have found for understanding OpenGL geometry is http://www.songho.ca/opengl/gl_transform.html
Good luck! 🙂