texture pblm !!!!!!!!!!!!!


am trying to add textures to my figures. in a sample pgm i found, quadrics r being used and the texture image is being directly loaded. in another pgm in which quadrics r not being used, an entire function has been written 2 convert the texture into some other format.
is it necessary to write such functions, what is the difference in case of .png images?
i use Red Hat Linux 9.0 and Qt 3.1.1 . i draw a cubical structure, but i need to apply texture only to the top and bottom surfaces.

another pblm:
the sample pgm i mentioned, will run with texture only if i give the “./exename” command in the console. if i double click the executable file icon in the folder, the pgm runs without the texture. - the sample pgm “texture” supplied along with the Qt examples.
could someone plz explain the reason for this?


How come nooo response!!!

It is a bit hard to understand what exactly your question is, but it seems that you simply want to know how to load textures.

There are tho ways, a) use an existing library and b) write your own function, but you somehow have to get the image in the file into your memory, in the format you want it to have (for example RGB or RGBA).

I would recommend to either write a ppm/ascii-loader yourself (VERY easy) or use libjpg to load jpeg files (QUITE easy g).

I hope this helps a bit.

And maybe people ar more willing to respond if you do not use so many “!” in the title .