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.
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
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
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/
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(...);
Powered by vBulletin® Version 4.2.0 Copyright © 2013 vBulletin Solutions, Inc. All rights reserved.