Camera Rotation Whitout Matrix,
Members - Reputation: 146
Posted 26 June 2001 - 01:55 PM
Members - Reputation: 1323
Posted 26 June 2001 - 02:40 PM
OpenGL Game Programming Tutorials
Members - Reputation: 316
Posted 26 June 2001 - 03:02 PM
But yes, since you have those three vectors, gluLookAt is just what you need. That function wants those exact vectors you already have!
Members - Reputation: 122
Posted 26 June 2001 - 11:40 PM
The gluLookAt function defines a viewing transformation.
eyex, eyey, eyez
The position of the eye point.
centerx, centery, centerz
The position of the reference point.
upx, upy, upz
The direction of the up vector.
The gluLookAt function creates a viewing matrix derived from an eye point, a reference point indicating the center of the scene, and an up vector. The matrix maps the reference point to the negative z-axis and the eye point to the origin, so that when you use a typical projection matrix, the center of the scene maps to the center of the viewport. Similarly, the direction described by the up vector projected onto the viewing plane is mapped to the positive y-axis so that it points upward in the viewport. The up vector must not be parallel to the line of sight from the eye to the reference point.
The matrix generated by gluLookAt postmultiplies the current matrix.