View Full Version : 3D+2D
02-28-2001, 11:41 AM
What is the best way to overlay a 2D picture over a 3D graphics world. ie only the 3D world changes when the camera is moved?
Thanks in advance.
02-28-2001, 12:00 PM
the easyest way to do this would be to have ur 2d art as a texture and place that over a quad or any shape needed.
now u could either place code to draw this at the toc of ur display method in which case it will not be affected by any transformation calls later or u can place it anywhere in the display method if u use the glPopMatrix() and glPushMatrix() calls and place your quad in between these 2 calls this will stop any previouse transformations to effect the quad.
or u could draw your 3d world first the use glLoadIdentity() and then draw the quad
02-28-2001, 02:48 PM
How efficient would that be? This 2D art is pretty trivial so the less time the machine spends on the 2D... Although I'm have some fairly decent experience with 3D engines I'm new to Open GL which leads me to another question. How does this viewport thing work (not transformations) I hear it is possible to have multiple in the same window. How is this possible and what are the limitations of this? The 2D art is seperate from the 3D. Would it be possible to put the 2D stuff on one viewport and have the 3D occupy the other viewport?
Thanks for your time...
er, overlay planes, you mean? That'd work, but only if your window manager supports overlays. There is nothing stopping you from changing projection matricies, btw. You don't HAVE to commit to a single projection matrix:
/* 3d stuff */
/* 2d stuff */
/* back to 3D */
and so on.
02-28-2001, 07:26 PM
Holy dumb question Batman...
A little trip to the library and some books goes a long way eh?
Thanks for the info. http://www.opengl.org/discussion_boards/ubb/smile.gif
Powered by vBulletin® Version 4.2.2 Copyright © 2015 vBulletin Solutions, Inc. All rights reserved.