PDA

View Full Version : opengl -how to import a created image



bindudevi
11-22-2005, 09:22 PM
Hi,
I'm new to opengl.
I want to render the surface of the image created by another opengl program..
I don' know how to store and call a 3D image to another program..
Could you please help me in finding a link to sample code that uses an imported image..?
Thank You
:)
bindu k

mikael_aronsson
11-22-2005, 10:58 PM
Hi !

I am not sure what you want to do here, if you want to load an image file from disk and display it in OpenGL, then you need code that can read that specific file format (www.sourceforge.net and www.freshmeat.net (http://www.freshmeat.net) is your friend here), then you can use glDrawPixels to put an image stored in ram (in one of the formats supported by OpenGL)on the framebuffer.

Another alternative if you need more performance is to put the image as texture on a quad or other polygon.

But as I said, I am not sure what you want to do with your image.

Mikael

11-23-2005, 12:59 AM
Here's a simple tutorial that shows how to load a bitmap image, and bind it as a texture to a 3D object:

http://nehe.gamedev.net/data/lessons/lesson.asp?lesson=06

Dan.