Confused About My Code Suggesting The Normal Matrix Is Equivalent To The ModelView Matrix

In his vertex shader, the author calculates the vertex normal in eye space with the following code:

nEye = vec3(viewMatrix * modelMatrix * vec4(vertexNormal, 0.0));


This works, but I've fooled around and made modifications to the shader code, so that it calculates the vertex normal with this code:

nEye = vec3(normalMatrix * vec4(vertexNormal, 0.0));


Where normalMatrix is a uniform 4x4 matrix I calculated outside the shader:

objectNormalMatrix = viewMatrix * modelMatrix;
objectNormalMatrix.invert();
objectNormalMatrix.transpose();


(I read from this question that the above is how you are supposed to calculate the normal matrix).

For either method of calculating the vertex normal I use, I get the same (working) graphical result, and this is what is confusing me.

My question is, why is(viewMatrix * modelMatrix) apparently equivalent normalMatrix? In calculating the normal matrix, I invert and transpose, but I do none of that when just multiplying by (viewMatrix * modelMatrix).

Here is some extra info that might be relevant:

• The matrix library I use in my application is column major order (same as OpenGL).
• When I pass my matrices to GLSL with glUniformMatrix, I have transpose as false.
• The view matrix and model matrix in GLSL are uniforms from the application, and they are the exact same view matrix and model matrix matrices I use in my calculation of the normal matrix.
• If viewMatrix * modelMatrix does not contain any shear or non-uniform scaling term, then the normal matrix is just the upper 3x3 of the modelview matrix, which has the same effect as multiplying the modelview by (x,y,z,0) instead of (x,y,z,1). Shear and nonuniform scale are fairly rare nowadays, which explicit meshes. – user41442 Mar 28 '15 at 22:40
• @Jason Yup, when I apply a nonuniform scale to the model matrix, (viewMatrix * modelMatrix) doesn't work but normalMatrix does! Thanks for the help, I will accept if you post this as an answer. – Aaron Mar 28 '15 at 22:57