First person shooter weapon in viewspace? #3130
Replies: 2 comments 1 reply
-
Also, the model is just a cube so it shouldn't be that.
And I'm pretty sure the shader is correctly accepting the uniform. |
Beta Was this translation helpful? Give feedback.
-
I think I'm making progress. If I call the draw function inside My code is now
However, if I use the perspective matrix, the weapon doesn't show up at least as far as I can tell while fiddling with the offsets to make sure its not a culling issue. If I use an identity matrix for the perspective, everything is working as intended EXCEPT that the model is stretched. I'm assuming this is an issue with the aspect ratio. Anyone know how to solve this? |
Beta Was this translation helpful? Give feedback.
-
Hi everyone - I'm trying to build a simple 3D first person shooter. I'm having a very hard time figuring out how to render the weapon in an FPS game relative to the camera.
My current approach is to try to get the weapon to render in view space (rather than world space) using a custom shader but for the life of me I can't get it to render correctly. It seems like the object is just warped and sheared (though pixels are getting drawn to the screen).
Any suggestions for how to fix this or to do it better?
Thanks!
The params in the function are manipulated by gui sliders.
Beta Was this translation helpful? Give feedback.
All reactions