I am now trying to change camera's view port under the given 4-by-4 matrix as
R11 R12 R13 transx
R21 R22 R23 transy
R31 R32 R33 transz
0 0 0 1
R is the 3-by-3 rotation matrix while transx, transy, transz are translations along x,y and z axis in 3D space.
My code is as following
eyex = transx;
eyey = transy;
eyez = transz;
atx = transx;
aty = transy;
atz = transz+1;
gluLookAt (R11*eyex + R12*eyey + R13*eyez, R21*eyex + R22*eyey + R23*eyez, R31*eyex + R32*eyey + R33*eyez, atx, aty, atz, 0.0, 1.0, 0.0);
However, I can't get the correct result. (Rotatation seems ok but problems occurs on translation)
Could someone can pick up the error in my code?