How do I map a jpeg onto a sphere?

I am in the process of making a model of the solar system and I would like to map surfaces of the planets for a more realistic effect. View what I have at: http://tor.lab.cwu.edu:9004/correllt/440/files/theFinal.exe . I would prefer to map the surface of the spheres with jpegs, but I am open to using bitmaps and gifs as well. Any help would be greatly appreciated. Thanks!

[This message has been edited by correll (edited 12-03-2002).]

[This message has been edited by correll (edited 12-03-2002).]

Hi !

There are lot’s of libraries out there to load images as textures, not sure if anyone can handle jpeg’s, but try a search on google, I am pretty sure you will find something that fits the bill.

Mikael

I’m not sure what your question is. You have to decompress them before you load them into the GL anyway, so it’s just a matter of how much space they take up on disk. Once you know how to load in a JPEG, you just texture map them onto the spheres.

Originally posted by Aaron:
I’m not sure what your question is. You have to decompress them before you load them into the GL anyway, so it’s just a matter of how much space they take up on disk. Once you know how to load in a JPEG, you just texture map them onto the spheres.

Thank you. I am still new to this, and I don’t know how to texture map onto spheres. Is there a simple way to do that in c++?

I have a textured mapped sphere example on my website call glball, written in C, but should not take much effort to change to C++.
http://www.angelfire.com/linux/nexusone/

Originally posted by correll:
Thank you. I am still new to this, and I don’t know how to texture map onto spheres. Is there a simple way to do that in c++?

That example uses gluSphere() to generate the sphere and does the texture mapping.

What if he already has a sphere, (perhaps as part of a larger model loaded from a file), and wants to texture-map that, (i.e., not generate a whole new sphere using the gluSphere function).

Of course he could do it the hard way, by manually calculating all the texture coordinates one by one for each triangle in the sphere. Is there an easier way though?

It seem to me that he was looking for a simple answer.

And for generating textures for planets as per his post should work fine.

Originally posted by Merry Christmas:
[b]That example uses gluSphere() to generate the sphere and does the texture mapping.

What if he already has a sphere, (perhaps as part of a larger model loaded from a file), and wants to texture-map that, (i.e., not generate a whole new sphere using the gluSphere function).

Of course he could do it the hard way, by manually calculating all the texture coordinates one by one for each triangle in the sphere. Is there an easier way though?[/b]

Luis Sempe has an excellent article on SkySphere’s in this ZIP file .

Would suggest avoiding JPG’s in favour of TGA or even BMP. I think the Intel JPG library is now a chargeable item.

are you by chance doing this for a school project? final project, say, for MAE473 at UB?

EDIT: checking your profile, I guess not. I just met somone this morning in class that said he was doing his final project modeling the solor system. I just thought maybe you were him. sorry

[This message has been edited by KenR7A (edited 12-04-2002).]

I would use devil go to http://openil.sourceforge.net/