Part of the Khronos Group
OpenGL.org

The Industry's Foundation for High Performance Graphics

from games to virtual reality, mobile phones to supercomputers

Results 1 to 5 of 5

Thread: texture & light

  1. #1
    Junior Member Regular Contributor
    Join Date
    Apr 2003
    Location
    France
    Posts
    114

    texture & light

    here is my problem : i can load some sphere (they are a solar system), no problem.
    aside, i can load a tga texture, no problem

    but when i want both at the same time, i get the planet reder, but the texture is so so dark that i almost see it...

    so the problem would be the render of a light on a texture... if anybody can help great thx

    wizzo
    You snooze, you loose

  2. #2
    Intern Contributor
    Join Date
    Apr 2003
    Location
    Turin, Italy
    Posts
    94

    Re: texture & light

    hi there,
    i had a similar problem with the rendering of a terrain. when i turned the lights on, pooof, all the land became dark. U simply have to supply the vertex normals for every vertex of the sphere. Boring but necessary. Lemme now if that was of any help. Bye and good luck, the Gunslinger

  3. #3
    Junior Member Regular Contributor
    Join Date
    Apr 2003
    Location
    France
    Posts
    114

    Re: texture & light

    ok thx
    the problem is that i am a real beginner, and that i don't know how to do the normal to a sphere... can you help me doing it (i used glut for the sphere) ?
    thx for your help, really - now if i dont know how to solve the problem, i know what it is which is good =D

    wizzo
    You snooze, you loose

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

    Re: texture & light

    Part of you problem maybe is that glutSolidSphere does not have any texture coors, only normals.

    If you want to use a texture can use gluSphere and have it create normals and texture coords for you.

    example:

    sphere = gluNewQuadric();
    gluQuadricDrawStyle( sphere, GLU_FILL);
    gluQuadricNormals( sphere, GLU_SMOOTH); // Normals setting for glu objects
    gluQuadricOrientation( sphere, GLU_OUTSIDE);
    gluQuadricTexture( sphere, GL_TRUE); // Create texture coords.

    If you want the complete code, look at glball demo on my website,uses glut for window creation and gluSphere:
    www.angelfire.com/linux/nexusone/


    Originally posted by wizzo:
    ok thx
    the problem is that i am a real beginner, and that i don't know how to do the normal to a sphere... can you help me doing it (i used glut for the sphere) ?
    thx for your help, really - now if i dont know how to solve the problem, i know what it is which is good =D

    wizzo
    [This message has been edited by nexusone (edited 04-16-2003).]

    [This message has been edited by nexusone (edited 04-16-2003).]

  5. #5
    Junior Member Regular Contributor
    Join Date
    Apr 2003
    Location
    France
    Posts
    114

    Re: texture & light

    hum.... gluquadric is to map the texture to the shere right ? my original problem was to apply a texture to a square, behind the sphere but i couldnt map a texture to a sphere too, so thx, that helped me too =) i'm gonna try that
    wizzo
    You snooze, you loose

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •