trishLEX

Lighting

May 3rd, 2017
277
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Python 1.17 KB | None | 0 0
  1. def makeLighting():
  2.     glEnable(GL_LIGHTING)
  3.     glEnable(GL_LIGHT0)
  4.  
  5.     glLightfv(GL_LIGHT0, GL_POSITION, (0, 0, 0, 0))
  6.     glLightfv(GL_LIGHT0, GL_AMBIENT | GL_DIFFUSE | GL_SPECULAR, (0, 0, 0, 1))
  7.  
  8.     glLightModelfv(GL_LIGHT_MODEL_AMBIENT, (0.5, 0.5, 0.5, 1))
  9.  
  10.     # glMaterialfv(GL_FRONT, GL_AMBIENT_AND_DIFFUSE, (1, 0, 0, 1)) ###рассеянный свет
  11.     # #glMaterialfv(GL_FRONT, GL_DIFFUSE, (1, 0, 0, 1)) ###другой рассеянный свет
  12.     # glMaterialfv(GL_FRONT, GL_SPECULAR, (0.1, 0.1, 0.1, 1)) ###отражаемый свет
  13.     # glMaterialfv(GL_FRONT, GL_EMISSION, (0.1, 0, 0, 1)) ###излучаемый свет
  14.     # glMaterialfv(GL_FRONT, GL_SHININESS, 128) #степень блеска
  15.  
  16.     glMaterialfv(GL_FRONT, GL_AMBIENT_AND_DIFFUSE, torus.glPnames.get(GL_AMBIENT_AND_DIFFUSE)) ###рассеянный свет
  17.     glMaterialfv(GL_FRONT, GL_SPECULAR, torus.glPnames.get(GL_SPECULAR)) ###отражаемый свет
  18.     glMaterialfv(GL_FRONT, GL_EMISSION, torus.glPnames.get(GL_EMISSION)) ###излучаемый свет
  19.     glMaterialfv(GL_FRONT, GL_SHININESS, torus.glPnames.get(GL_SHININESS)) #степень блеска
Add Comment
Please, Sign In to add comment