First Person Shooter Interface

Can anybody point me in the direction I need to go in in order to create a “HUD” for my first person shooter interface? Something that will display like the persons health etc.

I’m looking for mainly how to create a crosshair in the middle of the screen. Any help, links, information, or sample code would be greatly appreciated.

After you’ve drawn your scene, call matrixmode to projection then Ortho2d and draw your HUD, don’t forget to return to projection mode afterwards www.gametutorials.com , masking could be handy

[This message has been edited by M/\dm/
(edited 12-22-2002).]

	  glMatrixMode( GL_PROJECTION ); // For drawing the HUD
	  glOrtho(0, 100, 0, 100, 0, 1);
	  glLoadIdentity();
	  glColor3f(1, 1, 1);

I tried putting that in and drawing afterwards but I didn’t see anything. I’m a little confused about the near/far arguements. What should I put them to be considering I dont want depth?

I’ve tried testing it with glvertex2f and 3f and niether works…

Try this out:

glMatrixMode( GL_PROJECTION );
glOrtho(0, 100, 0, 100, 0, 1);
glLoadIdentity();
glColor3f(1, 1, 1);

//add this
glMatrixMode(GL_MODELVIEW);
glDisable(GL_DEPTH_TEST);

Now (0|0) is your lower left corner of the screen and (100|100) is the upper right corner of the screen.

That should solve your problem.

Jan.

I’ wrote return to prejection, should be modelview as in post above

So now I should be able to use glVertex2f to draw polygons and stuff right? I tried to and it doesnt appear to be working, maybe I just cant see the polygon…

Originally posted by 31337:
[b]Can anybody point me in the direction I need to go in in order to create a “HUD” for my first person shooter interface? Something that will display like the persons health etc.

I’m looking for mainly how to create a crosshair in the middle of the screen. Any help, links, information, or sample code would be greatly appreciated.[/b]


Well i have something 4U to take a look about Graphics pointers, crosshairs and HUDs
but it’s a .RAR, so give an e-mail address to sen U’daScraps!

Originally posted by 31337:
[b]Can anybody point me in the direction I need to go in in order to create a “HUD” for my first person shooter interface? Something that will display like the persons health etc.

I’m looking for mainly how to create a crosshair in the middle of the screen. Any help, links, information, or sample code would be greatly appreciated.[/b]

Try this: http://www.gametutorials.com/Tutorials/opengl/OpenGL_Pg1.htm