Original Post
hi, i can't understand how the following rotations of the camera is working. the rotations are done to make a camera's frustum point at the focal point. (xcam_1,ycam_1,zcam_1) is the camera's position. xfoc, yfoc and zfoc is focal point. GLdouble a = xfoc_1 - xcam_1, b = yfoc_1 - ycam_1, c = zfoc_1 - zcam_1; GLdouble v = sqrt(b * b + c * c); GLdouble alpha = atan( b/c)*180./3.1416; GLdouble beta = -atan(a/v)*180./3.1416; GLdouble g = far_1, h = g * tan(fovy_1*(width/winHeight_1)/2* 3.1416/180.); GLdouble e = near_1, f = e * tan(fovy_1/2. * 3.1416/180.); glTranslatef( xcam_1, ycam_1, zcam_1); glRotatef( -alpha, 1., 0., 0.); glRotatef( -beta, 0., 1., 0.);