Advertisement
trishLEX

Untitled

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