Does OpenGL warp 2D images?

Started by
3 comments, last by Davaris 22 years, 3 months ago
Hi I'm interested in making a 2D game using 3D acceleration. One thing that worries me is I want to make detailed interfaces like those seen in Fallout and Baldurs Gate. Last time I tried using Direct 3D and I found it warped the bitmaps and any text written on interfaces looked bad. Is it just that I was doing something wrong? Is it possible to render bitmaps in OpenGL exactly as they would appear in Direct Draw (no warping). Or is this just a "feature" of 3D engines. Edited by - Davaris on December 22, 2001 4:05:25 AM
"I am a pitbull on the pantleg of opportunity."George W. Bush
Advertisement
You can use the "Ortho" mode to draw in "2D". No distortion will take place if you do that. See NeHe''s tutorials for drawing text/textures in Ortho mode (vs. the Perspective mode).
Ive found OpenGL copes very well with 2D graphics in Ortho 2d mode. As long as your Ortho screen size matches the resolutions your in the 2D graphics should be perfect
The problem is that D3D and OGL wil strecth to fit the texture onto the polygon using the text coords and type of clapping you specified, that why you get the so called warp effect.

Also dont forget textures must have a width and size of multiples of 8 (8, 32, 64, 128, 256, 512) and also some cards can only a certain size...

So then you will have to cut up your interface in smaller pieces and glue them together....
When you use openGL and you want the icons and stuff to look nicer, don''t use GL_NEAREST, use GL_LINEAR or above calls. It will make it all nice and smooth for you. (ie; glTexParam)


Beer - the love catalyst
good ol'' homepage
Beer - the love catalystgood ol' homepage

This topic is closed to new replies.

Advertisement