Results 1 to 5 of 5

Thread: Texture mapping a sphere?

  1. #1
    Junior Member Newbie
    Join Date
    Nov 2002
    Location
    CA
    Posts
    5

    Texture mapping a sphere?

    I made a sphere using this code below:
    "
    GLUquadricObj *qobj = gluNewQuadric();
    gluQuadricDrawStyle(qobj, GLU_FILL);

    glColor3f(0,0,1);
    gluSphere(qobj, 1,40,40); "


    Does anyone know the simplest way to map a bmp file to the sphere? I'm completely lost here.


    I've been doing searches and it seems that gluQuadricTexture will work the best, but I don't know what to do with it, nor what else I need.

    Help?

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

    Re: Texture mapping a sphere?

    I have an example of texture mapping a glusphere on my website called glBall, I use a TGA file as my texture. But the idea is the same, just the routine for loading the image file is diffrent.

    http://www.angelfire.com/linux/nexusone/

    Originally posted by UnderWear:
    I made a sphere using this code below:
    "
    GLUquadricObj *qobj = gluNewQuadric();
    gluQuadricDrawStyle(qobj, GLU_FILL);

    glColor3f(0,0,1);
    gluSphere(qobj, 1,40,40); "


    Does anyone know the simplest way to map a bmp file to the sphere? I'm completely lost here.


    I've been doing searches and it seems that gluQuadricTexture will work the best, but I don't know what to do with it, nor what else I need.

    Help?


    [This message has been edited by nexusone (edited 12-18-2002).]

  3. #3
    Junior Member Newbie
    Join Date
    Nov 2002
    Location
    CA
    Posts
    5

    Re: Texture mapping a sphere?

    I think I'm in over my head.
    I went to site and found the sphere that you did, I just understand how you import a file to be mapped to the sphere?

    Is this correct below?
    I'm just really lost as to what else I need.
    Here's the part where I draw:

    glColor3f(0,0,1);
    GLUquadricObj *qobj = gluNewQuadric();
    glNewList(list[0], GL_COMPILE);
    gluQuadricOrientation( qobj, GLU_OUTSIDE);
    gluQuadricDrawStyle(qobj, GLU_FILL);
    gluQuadricNormals(qobj, GLU_SMOOTH);
    gluQuadricTexture( qobj, GL_TRUE ); //enable TexCoord generation
    gluSphere(qobj, 1,40,40);
    glEndList();
    gluDeleteQuadric( qobj );

    [This message has been edited by UnderWear (edited 12-18-2002).]

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

    Re: Texture mapping a sphere?

    I think http://www.gametutorials.com/ has a tutorial on quadrics that are also texture mapped. check that out.

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

  5. #5
    Junior Member Newbie
    Join Date
    Nov 2002
    Location
    CA
    Posts
    5

    Re: Texture mapping a sphere?

    hehe. Yeah, I looked at that but for some reason kept give me unresolved external errors.

    Thanks for the help though. I'll keep trying.

    I hate computers.

Similar Threads

  1. Sphere texture mapping
    By pedr0 in forum OpenGL: Basic Coding
    Replies: 1
    Last Post: 12-22-2010, 05:04 AM
  2. Sphere Texture Mapping
    By girish3110 in forum OpenGL: Basic Coding
    Replies: 2
    Last Post: 01-07-2008, 11:21 AM
  3. Texture Mapping a Sphere
    By OGL_PGR in forum OpenGL: Basic Coding
    Replies: 2
    Last Post: 12-10-2006, 08:16 AM
  4. Mapping texture to an sphere
    By thorsan in forum OpenGL: Basic Coding
    Replies: 2
    Last Post: 02-23-2004, 12:10 PM
  5. Texture mapping on sphere
    By abhiboy007 in forum OpenGL: Basic Coding
    Replies: 2
    Last Post: 07-19-2001, 02:39 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