PDA

View Full Version : Texture mapping



06-14-2002, 11:21 PM
I am trying to texture map, but is there any way to import a bitmap file to the scene?

satan
06-15-2002, 05:13 AM
Originally posted by Mathur:
I am trying to texture map, but is there any way to import a bitmap file to the scene?

OpenGL does not provide any file loading routines. So you have to take care yourself of getting your file loaded. For many languages you can find bitmap loading libs either as part of a development package or on the net.

zen
06-15-2002, 06:50 AM
If you want to do things yourself(and it might be a good idea if your starting out) get the specs from a format(like targa tga) and write a loader(which isn't hard to do).Otherwise have a look at the DevIL library.

rhmazza
06-27-2002, 09:51 AM
Or, if you just want to work with code that's already written to load TGA files, I recommend NeHe's tutorials. His page is at http://nehe.gamedev.net
(I'm pretty sure that's it... it's down right now so I'm not positive. You can always just google it (nehe and opengl) and it comes up first.
Anyway, under his opengl tutorials, up in the teens he's got one on loading TGAs and it's not too much code.

zen
06-27-2002, 12:56 PM
just be careful because last time I checked there wasn't any code to handle the image origin mechanism so some tgas might get loaded reversed.Depends on the program that saved the tga(it was the case with gimp for instance).