openGL polygon lighting

honkFactory
Unregistered
 
Post: #1
Howdy,
I am trying to introduce lighting into an openGL app. The shape that I am trying to light is a box. Some sides have a tecture mapped onto them. Others just have colors defined at the vertices which blend throughout the surface. However when I tenable lighting the colored surface all appear a flat red brown color while the tectured surface look fine. Anyone know what going on? I noticed that when lighting is off, if I call glColor3f with a blue color arguement before I texture a surface only the blue component of the texture appears. But if I do the same thing with lighting on the texture looks normal. Does glColor3f have no effect when lighting is on?
A.W.
Quote this message in a reply
blb
Unregistered
 
Post: #2
Quote:Originally posted by honkFactory
Howdy,
I am trying to introduce lighting into an openGL app. ... Does glColor3f have no effect when lighting is on?
A.W.


Nope, you need to deal with material properties when lighting is enabled; check out OpenGL Lighting FAQ for some useful info.
Quote this message in a reply
henryj
Unregistered
 
Post: #3
Colours work completely diferent when lighting is enabled. Check out...

http://www.sjbaker.org/steve/omniv/opengl_lighting.html

It's s pretty good tutotial.
Quote this message in a reply
Post Reply 

Possibly Related Threads...
Thread: Author Replies: Views: Last Post
  Lighting and changing texture colors in OpenGL agreendev 2 7,774 Aug 13, 2010 03:47 PM
Last Post: agreendev
  Polygon budgets Kerome 1 2,918 Mar 7, 2010 04:55 AM
Last Post: mikey
  glut polygon winding strangeness OptimisticMonkey 2 3,099 Sep 7, 2009 06:27 PM
Last Post: OptimisticMonkey
  2D Dynamic Lighting in OpenGL! Sort of... metacollin 22 18,216 Aug 19, 2009 01:48 AM
Last Post: Madrayken
  Getting the Normal for a polygon. Jaden 3 5,836 May 1, 2009 01:47 PM
Last Post: Nosredna