In the gluLookAt function zAxis = target - cameraPosition and then in a view matrix we put -zAxis or we can write that zAxis = cameraPosition - target and then in a view matrix we put zAxis to get the same result. Why we have to negate zAxis in the first case or change order of operation in the second case ?
In the gluLookAt function zAxis = target – cameraPosition and then in a view
Share
In OpenGL, the standard camera space is a right-handed coordinate system. +X goes to the right, and +Y goes up. Because it’s right-handed, +Z goes behind the viewer. Thus the viewer is looking along the -Z axis. Hence the negation.