PDA

View Full Version : How do I map a jpeg onto a sphere?



correll
12-03-2002, 09:59 AM
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).]

mikael_aronsson
12-03-2002, 10:34 AM
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

*Aaron*
12-03-2002, 10:37 AM
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.

correll
12-03-2002, 10:45 AM
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++?

nexusone
12-03-2002, 11:52 AM
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++?

12-03-2002, 06:21 PM
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?

nexusone
12-04-2002, 05:01 AM
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:
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?

ppinter1
12-04-2002, 01:41 PM
Luis Sempe has an excellent article on SkySphere's in this ZIP file (http://www.spheregames.com/files/SkyDomesPDF.zip) .

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

KenR7A
12-04-2002, 01:59 PM
are you by chance doing this for a school project? final project, say, for MAE473 at UB? http://www.opengl.org/discussion_boards/ubb/smile.gif

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 http://www.opengl.org/discussion_boards/ubb/wink.gif

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

dheitbri
12-05-2002, 07:46 AM
I would use devil go to http://openil.sourceforge.net/