Ejemplo n.º 1
0
 /** Render this material in OpenGL2. */
 public void render() {
   GL2 gl = GLContext.getCurrent().getGL().getGL2();
   gl.glEnable(GL2.GL_COLOR_MATERIAL);
   gl.glMaterialfv(GL2.GL_FRONT_AND_BACK, GL2.GL_AMBIENT, ambient.getComponents(), 0);
   gl.glMaterialfv(GL2.GL_FRONT_AND_BACK, GL2.GL_DIFFUSE, diffuse.getComponents(), 0);
   gl.glMaterialfv(GL2.GL_FRONT_AND_BACK, GL2.GL_SPECULAR, specular.getComponents(), 0);
   gl.glMaterialfv(GL2.GL_FRONT_AND_BACK, GL2.GL_EMISSION, emission.getComponents(), 0);
   gl.glMateriali(GL2.GL_FRONT_AND_BACK, GL2.GL_SHININESS, shininess);
 }