I’ve got some problems with setting the lights in my project (using Java opengl bindings).
I’m trying to set up lights to illuminate the whole scene. is there any way to set the intensity of a light (in the infinity)
I set up light0 but still the whole scene is pretty dark.
My code is the following:
float light_pos[] = {-5, -5, -5, 0};
float light_color_am[] = {1, 1, 1};
float light_color_diff[] = {1, 1, 1};
float light_color_spec[] = {1, 1, 1};
gl.glLightfv(GL.GL_LIGHT1, GL.GL_POSITION, light_pos,0);
gl.glLightfv(GL.GL_LIGHT1, GL.GL_AMBIENT, light_color_am,0);
gl.glLightfv(GL.GL_LIGHT1, GL.GL_DIFFUSE, light_color_diff,0);
gl.glLightfv(GL.GL_LIGHT1, GL.GL_SPECULAR, light_color_spec,0);
gl.glLightf(GL.GL_LIGHT1, GL.GL_SHININESS, 150);
gl.glEnable(GL.GL_LIGHTING);
gl.glEnable(GL.GL_LIGHT0);gl.glEnable(GL.GL_LIGHT1);
gl.glEnable(GL.GL_LIGHT2);
gl.glEnable(GL.GL_LIGHT3);
gl.glEnable(GL.GL_DEPTH_TEST);
the result is the following:
the ground is supposed to be a checkerboard using materials black plastic and white plastic from the following source:
http://devernay.free.fr/cours/opengl/materials.html
but the fields are displayed really weird…
thank you for your help.