PDA

View Full Version : Help with texture !



Giordano
11-02-2005, 05:24 PM
Hi to everyone !

I would like to know hot to map a texture (from a file ) on a polygon drawn with OpenGl.
I have for example an image (.bmp, .jpg....) and i want to use it as texture for a polygon in my opengl application, for example to "cover" the surface of a sphere or a cube. Someone can help me ??

Thanks ,

G.

hernan
11-03-2005, 04:04 AM
I recommend that you read these tutorial about texture mapping:

NeHe\'s Tutorial 6: Texture Mapping (http://nehe.gamedev.net/data/lessons/lesson.asp?lesson=06)
NeHe\'s Tutorial 7: Texture Filters (http://nehe.gamedev.net/data/lessons/lesson.asp?lesson=07)

These are excelent demostrations about OpenGL texture mapping methods (at the bottom of every tutorial page, you have various ports to different platforms).

Of course, you should also read the OpenGL Programming Guide to have a complete understanding of how texture works.

Bye