View Full Version : rgba and texturemapping

03-04-2001, 09:57 PM
I need to know how to open/read an rgba file in C on a unix box, and then texturemap it to a sphere.
First one to answer gets... well, nothing, but I'll appreciate it.

Tha' Moo.

03-04-2001, 10:16 PM
their are probably librarys you can download but here is the specs

you should also search sgi's website for info as the .sgi format is the same thing and I know they release dll's for free for windows I would expect that they would for unix

03-04-2001, 10:39 PM
After some research I found a function to do it (although it is untested). It is not mine, so you must check out whether you may use it or not....

here is the link

specifically here and here and here http://www.cs.utah.edu/classes/cs5610/assignments/lab2/texture.c http://www.cs.utah.edu/classes/cs5610/assignments/lab2/texture.h http://www.cs.utah.edu/classes/cs5610/assignments/lab2/example.c

03-04-2001, 11:19 PM
Many thanks

03-05-2001, 07:24 AM
Paul Bourke, master programmer published these ...

Loading 32 bit targa images (with source code) : http://astronomy.swin.edu.au/pbourke/dataformats/tga/

Loading 32 bit SGI images (with source code) : http://astronomy.swin.edu.au/pbourke/dataformats/sgirgb/

03-06-2001, 08:26 PM
If all u want is to texture map a sphere with a rgba image, then that is easy.
Just use glTexImage2d(GL_TEXTURE_2D, //target
0, //Level Of detail.
4, // RGBA
GL_RGBA, // format
image // The actual data
If u want to read a rgba image, u can use glReadPixels(...);