Results 1 to 6 of 6

Thread: Why is my model lit so incorrectly.

  1. #1
    Junior Member Newbie
    Join Date
    Apr 2001
    Location
    UK
    Posts
    26

    Why is my model lit so incorrectly.

    I have a model rotating which works fine but when I add a a light source the model becomes the colour of the light source and you cannot see any of the original colour.

    If anyone wants a screenshot then email me: stockton@coventry.ac.uk

    Thanks

    Simon

  2. #2
    Senior Member Regular Contributor
    Join Date
    Nov 2000
    Location
    State College, PA
    Posts
    186

    Re: Why is my model lit so incorrectly.

    When you set the color of a model that you are going to light, use glMaterialColor*(), not glColor.

    Chris

  3. #3
    Junior Member Newbie
    Join Date
    Apr 2001
    Location
    UK
    Posts
    26

    Re: Why is my model lit so incorrectly.

    I presume that you mean in my case
    glmaterialcolor3f.

    I tried this but the program won't compile glmaterialcolor3f is not recoqnised.

  4. #4
    Senior Member Regular Contributor
    Join Date
    Jun 2000
    Location
    B.C., Canada
    Posts
    367

    Re: Why is my model lit so incorrectly.

    It's glColorMaterial3f(...)

    j

  5. #5
    Junior Member Newbie
    Join Date
    Apr 2001
    Location
    UK
    Posts
    26

    Re: Why is my model lit so incorrectly.

    I don't know if this is what you ment but firstly I did

    glColorMaterial GL_FRONT, gl_diffuse
    glEnable GL_COLOR_MATERIAL

    but also used

    glColor3f for each color that I set

  6. #6
    Senior Member Regular Contributor
    Join Date
    Nov 2000
    Location
    State College, PA
    Posts
    186

    Re: Why is my model lit so incorrectly.

    Originally posted by j:
    It's glColorMaterial3f(...)

    j
    Oops - right

Similar Threads

  1. Small textures coloured incorrectly
    By imported_Olive_ in forum OpenGL: Basic Coding
    Replies: 3
    Last Post: 07-25-2018, 04:31 PM
  2. GL_LINE_LOOP drawing incorrectly
    By Alastair in forum OpenGL: Basic Coding
    Replies: 2
    Last Post: 08-07-2013, 08:22 AM
  3. Incorrectly textured cube
    By cpp_someone in forum OpenGL: Basic Coding
    Replies: 0
    Last Post: 07-15-2013, 05:07 AM
  4. glBlendColor(..) working incorrectly
    By zed in forum OpenGL: Advanced Coding
    Replies: 0
    Last Post: 07-12-2006, 02:55 AM
  5. openGL working incorrectly
    By Sir Fz in forum OpenGL: User Software
    Replies: 3
    Last Post: 11-07-2005, 02:53 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