Hi.
I know I’m digging up an old thread here. I’m just trying to get this working myself here and I’m having trouble understanding how matrices work in jogl and how they’re manipulated. I’ve used the gleem library to convert my float arrays to Mat4f to multiply them. Can anyone tell me if the following look correct?
tm, bm, lvm, lpm are Mat4f of transformMatrix, biasMatrix, lightViewMatrix and lightProjectionMatrix ( all float[16] )
//Calculate texture matrix for projection
//This matrix takes us from eye space to the light's clip space
//It is postmultiplied by the inverse of the current view matrix when specifying texgen
int j=0,k=0;
for(int i = 0; i < 16; i++) {
bm.set(j,k,biasMatrix[i]);
lpm.set(j,k,lightProjectionMatrix[i]);
lvm.set(j,k,lightViewMatrix[i]);
j++; if(j>3) j=0;
if(j==0) k++;
}
tm = bm.mul(lpm.mul(lvm)); //equivalent to MATRIX4X4 textureMatrix=biasMatrix*lightProjectionMatrix*lightViewMatrix; ?
I’ve done a lot of googling and searching this forum…
Basically, if anyone has any code they’d be willing to share to help me understand the matrix operations going on in the above tutorial, I would be very, very grateful!!
Thanks in advance…