LWJGL Light

Hey, i got some problems with Light :confused:

here the OpenGL3D init Code:


GL11.glLightModeli(GL11.GL_LIGHT_MODEL_LOCAL_VIEWER, GL11.GL_TRUE);
GL11.glEnable(GL11.GL_LIGHTING);
GL11.glEnable(GL11.GL_LIGHT0);
GL11.glEnable(GL11.GL_COLOR_MATERIAL);

here the render Code:


GL11.glPushMatrix();
GL11.glTranslatef(0, 0, -5);
GL11.glRotatef(45, 1, 0, 0);
GL11.glPushMatrix();
GL11.glTranslatef(2, 0, 0);
GL11.glRotatef(rot, 0, 1, 0);
VBOStore.get("test").draw();
GL11.glPopMatrix();
GL11.glPushMatrix();
GL11.glTranslatef(-2, 0, 0);
GL11.glRotatef(rot, 0, 1, 0);
GL11.glScalef(0.5f, 0.5f, 0.5f);
VBOStore.get("test").draw();
GL11.glPopMatrix();
GL11.glPopMatrix();

(it just draws the same model 2 times in different height/width/length)

and here the image:

Why don’t both models get affected by the light in the same way? :confused:

The Smaller Model is much brighter than the normal model, any idea why?

Okay, found the problem: When using GL11.glScalef(0.5f,0.5f,0.5f); it makes the normals in the model longer (i don’t actually know why, it should make them shorter too, no?) and if the normal doesn’t have the length of 1 the light changes. Longer normal -> brighter face, shorter normal-> darker face. how can i get arround that?

Added GL11.glEnable(GL11.GL_NORMALIZE); to the init code, working now :smiley: