Jump to content
  • Advertisement

Archived

This topic is now archived and is closed to further replies.

noxa

OpenGL 2D images in OpenGL

This topic is 6937 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

Hello, quick question (hopefully good answers :-) I need to display some 2D pictures in OpenGL, my problem is that when I do (I use the two-triangle method) they don''t position as I would like. As I am an ex-DX programmer (I have a recent intrest in Linux so I''m deciding to go multi-platform) I am used to blting to the backbuffer with simple x,y coords and getting exactly what I wanted. Unfortunatly OpenGL isn''t that easy (or just isn''t that documented :-) How do you position the image on the screen using x,y coords, is there a message like Blt, or is it just ''guess and check''? Also, I have heard of the method of turning the perspective off (or changing the value) to make objects render flat (with no warping) - how is this done? What I want to accomplish is a view like the game Total Annihilation, in which the camera is straight down. When I try now my objects warp to the side of the view. This would also be useful for a 3D editor, in which the different views would have to be very exact. Thanks for any help anyone call offer! it''s much appreciated!

Share this post


Link to post
Share on other sites
Advertisement
if using glut try gluOrtho2D if not glOrtho (but here u have to play a little with the values of distance of the fustrum of the camera

hope it helps

Share this post


Link to post
Share on other sites
Another iteration of "How to do 2D in OpenGL".

We need a FAQ.

You can download the source code for the OpenGL driver system I wrote for Genesis3D (Eclipse, then WildTangent''s OpenSource game engine). It''s here.

Anyway, its tied to Genesis3D, so it can''t be seperately compiled or used..But it''s pretty cleanly coded, not too long, and it does both 2D decal and regular 3D drawing (and as such should be a pretty good guide as to how you can play with the projections to make 2D work.

Share this post


Link to post
Share on other sites

  • Advertisement
×

Important Information

By using GameDev.net, you agree to our community Guidelines, Terms of Use, and Privacy Policy.

GameDev.net is your game development community. Create an account for your GameDev Portfolio and participate in the largest developer community in the games industry.

Sign me up!