   recalculate normals after rotating geometry
  I'm writing a level editor program which works as a tile system. I've made a tile that has 6 faces, each with 1 normal. the faces go together and form a wall. The user has the ability to rotate the wall's 90 degrees but when I rotate the mesh, the normals remain the same which makes the lighting all wrong for the 90 and 270 degree rotated walls. Inside glsl theres a matrix called glNormalMatrix but I can't modify that matrix in my app? glMatrixMode(GL_NORMAL) isn't valid. I wish it was. But anyway, I need a way to rotate the normals x Degrees. Any good way to do that? Is there a NormalMatrix?   
  Multiplying your normals by the normal-matrix will transform them into view-space so they will always face the camera.If you just want them transformed back into their previous space before rotation, isn't it just a multiplication with the inverse model-matrix?(not sure if that will work, can't think straight right now)   ;  You can multiply them by any rotation you want, just use a 4x4 matrix uniform to send an arbitrary rotation matrix.However I'm pretty sure this isn't what you want to be doing. You rarely even need the glNormalMatrix, it is only different from the glModelViewMatrix slightly if you do non-uniform scaling. Otherwise you can just use the modelmatrix. You've probably just done something wrong with your lighting calculations, if you describe your setup a bit I'm sure you can get it worked out. Theres no reason why your lighting shouldn't work if you rotate the model.   ;  Oh I figured it out. When I placed an object I would rotate it 90 degrees but place the object where it would be if it was 270 degrees. (Its hard to explain) I'll just have to make corner pieces in my level editor to make it so that walls wont face away from lights at corners. (I have normal maps so if the wall faces away from the light it looks ugly) But wait, maybe someone knows how to get rid of this? When a normal mapped face is facing away from a light, its a mix of black and gray. Its ok if you dont, I'll just have to work around it.   ;  Hi,The user does not adjust the normal matrix in the client.  The normal matrix is updated automatically by transformations on the modelview matrix.  It is separate so that scaling the modelview matrix doesn't mess up the normals.  To see why that's necessary see here: http://www.lighthouse3d.com/opengl/glsl/index.php?normalmatrix.In your vertex shader:normal = gl_NormalMatrix*gl_Normal;vVertex = vec4(gl_ModelViewMatrix*gl_Vertex).xyz;Pass these to the fragment shader, normalize normal (because it has been interpolated), and then use it for lighting.  Ex, with:float diffuse_coefficient(gl_LightSourceParameters light) {    vec3 l = normalize(light.position.xyz-vVertex);    return max(dot(normal,l),0.0);}float specular_coefficient_ph(gl_LightSourceParameters light) {    return max(dot(reflect(normalize(vVertex-light.position.xyz),normal),normalize(-vVertex)),0.0);}These use lighting in eye space, which has advantages for advanced lighting techniques.  -G   