PDA

View Full Version : rgba and texturemapping



mooface
03-04-2001, 10: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.

Thanks,
Tha' Moo.

03-04-2001, 11:16 PM
their are probably librarys you can download but here is the specs
http://www.wotsit.org/download.asp?f=sgiimage

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, 11: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
http://www.cs.utah.edu/classes/cs5610/

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

mooface
03-05-2001, 12:19 AM
Many thanks

pleopard
03-05-2001, 08: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, 09: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
width,
height,
border,
GL_RGBA, // format
GLUBYTE,
image // The actual data
);
If u want to read a rgba image, u can use glReadPixels(...);