First person question

This is a discussion on First person question within the Game Programming forums, part of the General Programming Boards category; Hi Folks;
I'm attempting my hand at some first person game programming and the nature of the game requires a ...

First person question

Hi Folks;

I'm attempting my hand at some first person game programming and the nature of the game requires a reticule in the middle of the screen. To change my view of the world I do some rotations but I can't seem to keep my reticule in the screen. Can anyone offer some advice on this?

The easiest way to do it would be to put your reticle at a certain pixel coordinate after the 3d calculations are done-in essence you already have your picture of the 3d view, and then you paste the reticule over it. I haven't done it but the setup of opengl should make this easy to do. If you're using directx I have no idea what it would take.

That should do the trick. Render your vertices as XYZRHW. This tells Direct3D NOT to send the vertices down the rendering pipeline. In essence you are saying 'I've already transformed these vertexes to screen space....don't touch them.' What this translates to is that the x and y components of your vertices are rendered as is - in screen space - just like in a normal 2D game. So it's fairly straightforward how to move the object around in screen space so I omitted that code.

You can also use irregular shaped textures by using the correct alpha blending states.

You probably don't want to do this in each object's render function as it would be too slow. Turn alpha blending on, render all objects that use that type of alpha blending and then turn it off if need be or simply change the blending states to do different types of alpha blending.