Wednesday 27 April 2011

Lighting

  1. Direction light source
  2. Position light source
  3. glLightfv( Light#, Attribute, …)
  4. GLfloat position[] = {10, 10, 10, W} glLightfv(GL_LIGHT0, GL_POSITION, position) If (W) is zero the position is treated as a direction (a 1x3 vector); otherwise, it is treated as a position (a 1x4 vector)
  5. glEnable(GL_LIGTHING)
  6. glEnable(GL_LIGHT0)

No comments:

Post a Comment