Spela
11-15-2004, 12:58 AM
Is it possible to use the inverse of the MODEL_VIEW matrix for undoing the rotation and translation of the camera frame?
I have tried but it doesn't seem to be consistent - I have problems with the fact that the normal to the image plane always seems to be oriented in the positive z-direction after the modelview transformation and there is no way of telling where it was originally. This doesn't follow from the definition of the model_view matrix though.
I tried coding this and for the following:
gluLookAt(0.0,0.0,115.0,0.0,0.0,0.0,0.0,1.0,0.0)
glFrustum(-60.0,60.0,-60.0,60.0,40,200)
I get the model_view matrix:
1 0 0 0
0 1 0 0
0 0 0 -115
0 0 0 1
However, after the projection, all the z-coordinates on the image plane are positive, as if the normal of the image plane was pointing in +z, but it is not (I positioned the camera on the +z axis and looking towards the centre, which means the normal is (0,0,-1), but the rotation part of the modelview matrix in my case is an identity?!? )
What did I get wrong?
I have tried but it doesn't seem to be consistent - I have problems with the fact that the normal to the image plane always seems to be oriented in the positive z-direction after the modelview transformation and there is no way of telling where it was originally. This doesn't follow from the definition of the model_view matrix though.
I tried coding this and for the following:
gluLookAt(0.0,0.0,115.0,0.0,0.0,0.0,0.0,1.0,0.0)
glFrustum(-60.0,60.0,-60.0,60.0,40,200)
I get the model_view matrix:
1 0 0 0
0 1 0 0
0 0 0 -115
0 0 0 1
However, after the projection, all the z-coordinates on the image plane are positive, as if the normal of the image plane was pointing in +z, but it is not (I positioned the camera on the +z axis and looking towards the centre, which means the normal is (0,0,-1), but the rotation part of the modelview matrix in my case is an identity?!? )
What did I get wrong?