Results 1 to 3 of 3

Thread: Lighting

  1. #1
    Member Contributor
    Join Date
    Aug 2001
    Location
    sdddskskfj
    Posts
    54

    Lighting

    Have you guys already tryied to add lighting to objects that doesn't have a texture? I'm trying to do this, and it's almost working. I would like to be able to change the object color, but I added a glColor3f(withacolor), and the object don't change it's color. It is receiving the lighting, but the color don't change.

    Maybe I'm doing something wrong.

    Do you know what kind of problem I'm having?

    Thank you
    Fernando

  2. #2
    Senior Member Regular Contributor
    Join Date
    Jun 2002
    Location
    Philadelphia, PA, US
    Posts
    108

    Re: Lighting

    yeah, when you're using lighting, you need to use material properties instead of colors.

    look up the glMaterial*() functions.

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

    Re: Lighting

    Make sure that you use:
    glEnable(GL_COLOR_MATERIAL);
    when using lighting.


    Originally posted by Fernando:
    Have you guys already tryied to add lighting to objects that doesn't have a texture? I'm trying to do this, and it's almost working. I would like to be able to change the object color, but I added a glColor3f(withacolor), and the object don't change it's color. It is receiving the lighting, but the color don't change.

    Maybe I'm doing something wrong.

    Do you know what kind of problem I'm having?

    Thank you
    Fernando

Similar Threads

  1. How to introduce Specular and Diffuse lighting into Bumped lighting
    By Liable in forum OpenGL: Advanced Coding
    Replies: 3
    Last Post: 12-06-2004, 05:48 PM
  2. Lighting problem (opengl + shader lighting)
    By ox1d_47 in forum OpenGL: Basic Coding
    Replies: 1
    Last Post: 08-19-2004, 09:43 PM
  3. debug lighting vs release lighting
    By haust in forum OpenGL: Basic Coding
    Replies: 4
    Last Post: 10-30-2003, 10:43 AM
  4. lighting back facing triangles _without_ using two sided lighting
    By Nicolas Lelong in forum OpenGL: Advanced Coding
    Replies: 5
    Last Post: 02-07-2003, 03:05 AM
  5. About lighting (not OpenGL lighting, but general lighting)
    By Anonymous Coward in forum OpenGL: Basic Coding
    Replies: 2
    Last Post: 04-04-2001, 09:10 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