I'm newbie with OpenGL
How do you draw bitmap sprites in
If I understand your question correctly, you are trying to draw 2D images. Right?
Well, you will have to use ortho mode like this:
glLoadIdentity(); // Reset The Current Modelview Matrix
// Now you are in 2D...
// Draw something....
// Ending ortho mode...
glMatrixMode( GL_PROJECTION );
glMatrixMode( GL_MODELVIEW );
I hope that helps.
After going into ortho mode, you may want to display a texture on say a quad, to represent your sprite.
No code handy to show, as I am at work, but I am sure someone can show you if needed.
BTW Ortho mode has no Z axis so theres no point trying to do translations on it.
If your an OpenGL newbie, check out nehe.gamedev.net it has probably the best introductory and intermediate OpenGL tutorials on the net.
Also check out Game Tutorials
Rendering a 2d sprite is as simple (or not simple depending on how you look at it as rendering a quad with some texture coordinates. I'd suggest looking into getting the OpenGL Programming Guide (3rd ed), usually refered to as "the open red book". I find nehe's tutorials a really awful way to learn opengl.
Its also occured to me you might be asking about a technique called "billboarding." Billboarding is where a 2d sprite is rendered so its always facing the player. That topic is a little more involved, so I wont bother unless thats what you were asking about.
glOrtho is just a projection mode. z axis is specified (otherwise why specify near and far cliping planes with glOrtho?) but of course z translations are not visible for one single object. If you depth-test your objects, you'll see that far objects are occluded by near ones.
Besides using textured quads with glOrtho for sprites, and IFF it's only 2d images you want, there is also glDrawPixels, but it's too rigid to do anything fancy with it. Just puts a rectangular pixel area on screen...
If you depth-test your objects, you'll see that far objects are occluded by near ones.
Here is a compiled, and source code version of a OpenGL ortho mode project I was doing to see how fast I could get OpenGL on low end graphics cards, as well as learn OpenGL vertex arrays.
The demo also shows the far objects occluded by the card that zooms to and away from the screen as well you can see the mipmap (level of detail) effects on the cards as the zooming card goes back to its farthest point.