Take the 2-minute tour ×
Game Development Stack Exchange is a question and answer site for professional and independent game developers. It's 100% free, no registration required.

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?

share|improve this question
    
This gun looks like a 2d overlay to me. Are you expecting it to zoom? –  Skizz Oct 11 '11 at 14:26
    
The gun is a 3D model. Its a screenshot from Call of Duty. –  Neil Knight Oct 11 '11 at 14:26

1 Answer 1

up vote 6 down vote accepted

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

share|improve this answer
    
Care to share some code on narrowing the field of view? –  Neil Knight Oct 11 '11 at 14:14
2  
@Ardman you set the field of view when you create your projection matrix - recheck that bit of your code. –  Jonathan Dickinson Oct 11 '11 at 14:20
    
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. –  Neil Knight Oct 25 '11 at 14:38

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.