how to put text at X,Y,Z position and resolution problem

hi all,
iam doing a 3D radar screen and i have ended in a problem.

  1. the first problem is given
    X,Y and Z values(positions) how to print a text at that position.
  2. how to map the figure from window to viewport so that when i change the resolution of screen it should adjust itself with new resolution./

For the first problem use 2D font and glOrtho, about glOrtho you can find something in FAQ.

The best way would be to map all of your 2D images as texture maps, which can be resized to the window size.
Keep the glviewport relative to window size, but do not change glPerspective or ortho to match glviewport and window size.

Use texture map fonts for text not bitmap.

Originally posted by siddu78:
[b]hi all,
iam doing a 3D radar screen and i have ended in a problem.

  1. the first problem is given
    X,Y and Z values(positions) how to print a text at that position.
  2. how to map the figure from window to viewport so that when i change the resolution of screen it should adjust itself with new resolution./[/b]

thanx for the reply,
but can u eloaborate it bit more.

try out this page. http://www.gametutorials.com/Tutorials/opengl/OpenGL_Pg4.htm

and this http://nehe.gamedev.net/tutorials/lesson.asp?l=17

This is a ling on gametutorials.com which have awesome tutorials for beginners. They don’t just cover OpenGL but many other things like camera orientation, collision detection and even have stuff on quake model and bsp loading files.

The page above has 2 tutorials on 2d and 3d font. there is also a way described on nehe.gamedev.net

When you work with 2D bitmaps placed directly on the screen, one pixel to one pixel.

If you have a 320 x 200 image and use a ortho screen that is only say 300 x 200, some of the image will be cut off when you resize or area will be blank.

With a texture map image, the image will be rendered to fit the screen and not a pixel to pixel basis.

Originally posted by siddu78:
thanx for the reply,
but can u eloaborate it bit more.