Jump to content
  • Advertisement


This topic is now archived and is closed to further replies.


how to display 1st person shooter gun in ortho?

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

I am working on a 3D 1st person shooter and have created a 3D arm and gun which is positioned just in front of the camera. This works fine until I walk near to an object/wall and before the collision detection stops the camera the gun goes through the wall. Instead of changing all my collision detection to stop the camera really early I was wondering if it is possible to use the 3D vertex data for the gun and just project it 2D onto an orthographic screen so it was always above anything in the 3D world. i have tried drawing the gun after changing to Ortho mode but it still seems to be 3D and goes through walls. I know my Ortho mode works as I have been using 2D fonts with it. If anyone has done a similar thing before I would be grateful for a few pointers. Thanks, Richard

Share this post

Link to post
Share on other sites

Just do this :

glDepthRange (0, 0.3);
glDepthRange (0, 1.0);


Share this post

Link to post
Share on other sites

  • 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!