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 4 of 4

Thread: normals for sphere

  1. #1
    Junior Member Newbie
    Join Date
    Feb 2003
    Posts
    9

    normals for sphere

    Hi,

    I am making a solar system scene. I am using glutSolidSphere() to make the sun and the planets. I currently have ambient light for the scene and some sun emissive light.

    I would like for the side of each planet that is facing the sun to be lighted. I assume this is done using diffuse light. I think I have the initial setup right (except normals-declaration), but am not seeing the light effects.

    I did the following:
    -positioned a light (GL_LIGHT0) at the location of the sun
    -enabled LIGHT0
    -and I enabled the diffuse property of the planet material (GL_AMBIENT_AND_DIFFUSE)

    I know that I need normals for the surface so the diffuse intensity can be derived. So my question is this: does OpenGL 'know' the normals when using glutSolidSphere()? If not, is there an easy way to make some for a sphere?

    Any help is much appreciated!
    Thanks,
    Bob

  2. #2
    Intern Contributor
    Join Date
    Mar 2003
    Posts
    88

    Re: normals for sphere

    create an sphere made of lots of triagles
    youŽll have total control over the vertex normals

    or you can simply define a normal for your glut sphere using glNormalXX
    As shadows into darkness, the Ninja fades away

  3. #3
    Junior Member Newbie
    Join Date
    Apr 2003
    Posts
    12

    Re: normals for sphere

    Hello,

    as I know(maybe from redbook) You don't have to deal with normal if You use glutSolidSphere() for sphere drawing, because glut*() functions make the polygon mesh and normals too.

    Brown

  4. #4
    Junior Member Newbie
    Join Date
    Feb 2003
    Posts
    9

    Re: normals for sphere

    Thanks . . . I think I've got it, now.

Posting Permissions

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