Results 1 to 10 of 10

Thread: How do I map a jpeg onto a sphere?

  1. #1
    Junior Member Newbie
    Join Date
    Dec 2002
    Location
    Ellensburg, WA, USA
    Posts
    2

    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...s/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).]

  2. #2
    Senior Member OpenGL Pro
    Join Date
    May 2001
    Location
    Kristianstad,Skåne,Sweden
    Posts
    1,595

    Re: How do I map a jpeg onto a sphere?

    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

  3. #3
    Senior Member Regular Contributor
    Join Date
    Feb 2002
    Posts
    245

    Re: How do I map a jpeg onto a sphere?

    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.

  4. #4
    Junior Member Newbie
    Join Date
    Dec 2002
    Location
    Ellensburg, WA, USA
    Posts
    2

    Re: How do I map a jpeg onto a sphere?

    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++?

  5. #5
    Senior Member OpenGL Guru
    Join Date
    Jun 2000
    Location
    Gastonia, NC, USA
    Posts
    2,068

    Re: How do I map a jpeg onto a sphere?

    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++?

  6. #6
    Guest

    Re: How do I map a jpeg onto a sphere?

    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?

  7. #7
    Senior Member OpenGL Guru
    Join Date
    Jun 2000
    Location
    Gastonia, NC, USA
    Posts
    2,068

    Re: How do I map a jpeg onto a sphere?

    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?

  8. #8

    Re: How do I map a jpeg onto a sphere?

    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.

  9. #9
    Junior Member Newbie
    Join Date
    Nov 2002
    Posts
    20

    Re: How do I map a jpeg onto a sphere?

    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).]

  10. #10
    Junior Member Newbie
    Join Date
    Sep 2001
    Location
    Toledo OH
    Posts
    29

    Re: How do I map a jpeg onto a sphere?

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

Similar Threads

  1. Render a trimmed sphere ? (a quarter of sphere)
    By HaVyThoai in forum OpenGL: Basic Coding
    Replies: 1
    Last Post: 11-07-2007, 12:05 PM
  2. jpeg library
    By JanHH in forum OpenGL: Linux
    Replies: 4
    Last Post: 04-03-2003, 04:53 AM
  3. Sphere-sphere collision detection
    By Billy Lee in forum OpenGL: Basic Coding
    Replies: 2
    Last Post: 01-08-2003, 11:03 AM
  4. jpeg-bmp
    By -spirit- in forum OpenGL: Basic Coding
    Replies: 1
    Last Post: 12-16-2001, 07:58 AM
  5. JPEG
    By Bra'Tac in forum OpenGL: Basic Coding
    Replies: 9
    Last Post: 04-10-2001, 07:23 AM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Proudly hosted by Digital Ocean