I’m trying to get view dependant Cube mapping which can be obtained by multiplying the Texture matrix by the inverse model view matrix.
I’m doing everything the way it’s meant to be done, and yet shit won’t work correctly
Look into the function drawRoom(float size) in GLScene…grrrrrr I’m so pissed off
PS: If you have a lesser card than a Radeon 9500+ or GeForce 5200 +, you can still omit the code calling drawSceneShadedElements() where shaders are called and see that there is no reflection at all on the walls…
http://www.realityflux.com/abba/LWJGL/Dynamic%20Cube%20Map.rar
Bah forgot to mention that I fixed it on my own…
private static FloatBuffer getInverse(){
Matrix4f matrix = new Matrix4f();
matrix.load(modelView);
matrix.transpose();
/*matrix.m00 = ; matrix.m01 = ; matrix.m02 = ;*/ matrix.m03 = 0;
/*matrix.m10 = ; matrix.m11 = ; matrix.m12 = ;*/ matrix.m13 = 0;
/*matrix.m20 = ; matrix.m21 = ; matrix.m22 = ;*/ matrix.m23 = 0;
matrix.m30 = 0; matrix.m31 = 0; matrix.m32 = 0; matrix.m33 = 1;
matrix.invert();
matrix.transpose();
modelView.rewind();
matrix.store(modelView);
modelView.flip();
return modelView;
}
Someone should have implemented the matrix class like OpenGL; In column order :