Results 1 to 3 of 3

Thread: problem with opengl lighting

  1. #1
    Junior Member Newbie
    Join Date
    Jul 2005
    Posts
    20

    problem with opengl lighting

    among my glenables i have the following
    glShadeModel GL_SMOOTH
    glEnable GL_NORMALIZE
    glEnable GL_CULL_FACE
    glFrontFace GL_CW
    glEnable GL_LIGHTING

    glLightfv GL_LIGHT0, GL_POSITION, {1,1,1,1}
    glLightfv GL_LIGHT0, GL_DIFFUSE, {1,1,1,1}
    glEnable GL_LIGHT0

    glMaterialfv GL_FRONT, GL_AMBIENT_AND_DIFFUSE, {1,.5,.2,0}

    im wondering if theres a way to set the color of a polygon by using glcolor3f instead of having to call glMaterialfv everytime i want to change a polygon color?

  2. #2
    Guest

    Re: problem with opengl lighting

    Have you tried enabling GL_COLOR_MATERIAL?

  3. #3
    Junior Member Newbie
    Join Date
    Jul 2005
    Posts
    20

    Re: problem with opengl lighting

    sweet dude. thanks for that.

Similar Threads

  1. lighting problem in Opengl game Combat Mission
    By sfhand in forum OpenGL: User Software
    Replies: 1
    Last Post: 10-26-2010, 01:16 PM
  2. OpenGL lighting problem
    By Outtey in forum OpenGL: Basic Coding
    Replies: 1
    Last Post: 01-16-2010, 06:56 PM
  3. OpenGL Lighting Problem
    By iSina in forum OpenGL: Basic Coding
    Replies: 7
    Last Post: 07-20-2008, 05:50 PM
  4. Lighting problem (opengl + shader lighting)
    By ox1d_47 in forum OpenGL: Basic Coding
    Replies: 1
    Last Post: 08-19-2004, 09:43 PM
  5. A problem with OpenGL Lighting process
    By ClearMind in forum OpenGL: Basic Coding
    Replies: 2
    Last Post: 06-20-2004, 08:45 PM

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