2
\$\begingroup\$

I am in the midst of creating an FPS game using XNA. I am using the camera class from the First Person camera demo from dhpoware.com, and everything is working great. What I'd like to implement is the ability to press the right mouse click and then the view changes so that you look down the gun, like the following image:

scope

I have searched and searched but haven't found anything that will help me out, or at least point me in the right direction. Can anyone help?

\$\endgroup\$
2
  • \$\begingroup\$ This gun looks like a 2d overlay to me. Are you expecting it to zoom? \$\endgroup\$
    – Skizz
    Oct 11, 2011 at 14:26
  • \$\begingroup\$ The gun is a 3D model. Its a screenshot from Call of Duty. \$\endgroup\$ Oct 11, 2011 at 14:26

1 Answer 1

7
\$\begingroup\$

Isn't it as simple as rendering your gun geometry (or 2d HUD style gun) near the camera and narrow the field of view.

\$\endgroup\$
3
  • \$\begingroup\$ Care to share some code on narrowing the field of view? \$\endgroup\$ Oct 11, 2011 at 14:14
  • 2
    \$\begingroup\$ @Ardman you set the field of view when you create your projection matrix - recheck that bit of your code. \$\endgroup\$ Oct 11, 2011 at 14:20
  • \$\begingroup\$ I managed to do this using a 3D model. My code needed altering in order to adjust the offset of the gun model and also allow the code to alter the Field of View outside of the Camera class. \$\endgroup\$ Oct 25, 2011 at 14:38

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .