RE: lighting problem

"Pete Brubaker" <[email protected]> Fri, 27 Apr 2007 13:35:25 -0800
Newsgroups gmane.games.devel.opengl
Organization Fat City Network Services, San Diego, California
Message-ID <[email protected]>
Did you copy and paste this code as well?

    GLfloat mat_specular[] = { 1.0, 1.0, 1.0, 1.0 };
    GLfloat mat_shininess[] = { 50.0 };
    GLfloat light_position[] = { 1.0, 1.0, 1.0, 0.0 };

    glMaterialfv(GL_FRONT, GL_SPECULAR, mat_specular);
    glMaterialfv(GL_FRONT, GL_SHININESS, mat_shininess);
    glLightfv(GL_LIGHT0, GL_POSITION, light_position);
 

-----Original Message-----
Tamas Nagy
Sent: Friday, April 27, 2007 2:11 PM
To: Multiple recipients of list OPENGL-GAMEDEV-L

Hi!

I have a problem. I applied the lights described in

http://fly.cc.fer.hr/~unreal/theredbook/chapter06.html

to my scene. I copy-pasted the light code.
I have a box and a sphere both colored red.

When i apply lights glEnable(GL_LIGHTING), glEnable(GL_LIGHT0), everything
becomes gray.
Lighting works but everything is gray instead of red.

Tamas

__________________________________________________
Do You Yahoo!?
Tired of spam?  Yahoo! Mail has the best spam protection around
http://mail.yahoo.com
-----
FAQ and OpenGL Resources at:
  http://www.geocities.com/SiliconValley/Hills/9956/OpenGL

--
Author: Tamas Nagy
  INET: [email protected]

Fat City Hosting, San Diego, California -- http://www.fatcity.com
---------------------------------------------------------------------
To REMOVE yourself from this mailing list, send an E-Mail message
to: [email protected] (note EXACT spelling of 'ListGuru') and in the
message BODY, include a line containing: UNSUB OPENGL-GAMEDEV-L (or the name
of mailing list you want to be removed from).  You may also send the HELP
command for other information (like subscribing).

----- 
FAQ and OpenGL Resources at:
  http://www.geocities.com/SiliconValley/Hills/9956/OpenGL

-- 
Author: Pete Brubaker
  INET: [email protected]

Fat City Hosting, San Diego, California -- http://www.fatcity.com
---------------------------------------------------------------------
To REMOVE yourself from this mailing list, send an E-Mail message
to: [email protected] (note EXACT spelling of 'ListGuru') and in
the message BODY, include a line containing: UNSUB OPENGL-GAMEDEV-L
(or the name of mailing list you want to be removed from).  You may
also send the HELP command for other information (like subscribing).