Code: Select all
matrix4 worldViewInverse;
worldViewInverse = viewMatrix*worldMatrix;
worldViewInverse.makeInverse();
OpenGL has this gl_normalMatrix already calculated, but in DX you have to provide it yourself. But you can't leave out the inverse and transpose calculations of the world*view product. It all must be done together, that is, multiply view*world matrix (irrlicht reverse order of matrix multiplication...
If it works well without transposing the matrix, you can leave it out. But you have to make the inverse of the matrix of the RESULT of the view*world matrix.