1 / 6

OpenGL

Marc Neveu. OpenGL. 2 Modes Mode « manuel »: glDisable(GL_Lighting); glColor3f(r,v,b); Mode « avec modèle » glEnable(GL_Lighting); + lumières + matériaux. Illumination. Définir les lumières : glLightxx(n°,enum,param) ‏ ; ex : glLightfv(GL_LIGHT0, GL_POSITION, pos0);

ghalib
Download Presentation

OpenGL

An Image/Link below is provided (as is) to download presentation Download Policy: Content on the Website is provided to you AS IS for your information and personal use and may not be sold / licensed / shared on other websites without getting consent from its author. Content is provided to you AS IS for your information and personal use only. Download presentation by click this link. While downloading, if for some reason you are not able to download a presentation, the publisher may have deleted the file from their server. During download, if you can't get a presentation, the file might be deleted by the publisher.

E N D

Presentation Transcript


  1. Marc Neveu OpenGL

  2. 2 Modes Mode « manuel »: glDisable(GL_Lighting); glColor3f(r,v,b); Mode « avec modèle » glEnable(GL_Lighting); + lumières + matériaux Illumination

  3. Définir les lumières : glLightxx(n°,enum,param)‏; ex : glLightfv(GL_LIGHT0, GL_POSITION, pos0); Les allumer: glLightEnable(n°); ex :glEnable(GL_LIGHT0); Lumières

  4. GLfloat pos[4] = { 1.0, 2.0, 2.0, 1.0 }; glLightfv(GL_LIGHT1, GL_POSITION, pos); glLightfv(GL_LIGHT1, GL_AMBIENT, lamb); glLightfv(GL_LIGHT1, GL_DIFFUSE, ldif); glLightfv(GL_LIGHT1, GL_SPECULAR, lspec); glLighti(GL_LIGHT1, GL_SPOT_EXPONENT, 30); glLighti(GL_LIGHT1, GL_SPOT_CUTOFF, 90); Quelques caractéristiques de lumière

  5. Définir les matériaux: glMaterialxx(face,enum,param); ex : glMaterialfv(GL_FRONT,GL_DIFFUSE,red); Matériaux

  6. GLfloat mamb[4] = { 0.6, 0.6, 0.0 ,1.0}; glMaterialfv(GL_FRONT, GL_AMBIENT, mamb); glMaterialfv(GL_FRONT, GL_DIFFUSE, mdif); glMaterialfv(GL_FRONT, GL_SPECULAR, mspec); glMaterialf(GL_FRONT, GL_SHININESS, 100); Quelques caractéristiques de matériau

More Related