PDA

View Full Version : drawing 2d objects



08-20-2004, 04:25 PM
i was wondering if OpenGl could draw 2d images or just 3d images?

ZbuffeR
08-21-2004, 02:17 AM
You can draw 2D too. In fact 2D is just a special case of 3D, where the Z (depth) coordinate does no perspective divide.

You can specify 2D coordinates directly :
http://pyopengl.sourceforge.net/documentation/manual/glVertex.3G.html

For 2D in the sense of good old bitmaps and sprites, do not use the glDrawPixels commands, they are not fast enough on consumer cards. Much faster is to draw texture mapped quads. And that way you can do sprite zooms and rotations for free.