View Full Version : fonts

03-05-2002, 10:37 PM
I have just read the Chapter 8 from Red Book about Drawing Pixels, Bitmaps, Fonts, Images and noticed that all samples use glOrtho() function.

That means glBitmap can be used only with an orthographic projection matrix ?

03-06-2002, 12:03 AM
In short no.

glBitmap() requires a valid raster position. Look up glRasterPos*() and you'll notice that it works with up to 4 coordinates - x, y, z, and w which a clip coordinate not projected into the scene. This 3D position in window coordinates is used to position pixel and bitmap write operations. If the raster position coordinates are invalid then the write operations are ignored.

The glOrtho() function sets up an Orthographic projection that is the objects don't get smaller as they go into the distance. It still uses A 3D world.

It can be easier to use 2D coordinates on your screen when doing simple 2D rendering and so people often set this up using the gluOrtho2D(). Once this is done you only need to specify two coordinates relative to those you've just set up.

Just a final point - when you call glBitmap it will change the raster position.

Hope this helps a little.