# Controlling Camera and Line of Sight in OpenGL

Camera controlling is essential in 3D viewing. OpenGL provides a function gluLookAt() for this purpose. The syntax of the function gluLookAt() is
void gluLookAt ( GLdouble eyex,GLdouble eyey,GLdouble eyez,GLdouble centerx,GLdouble centery,GLdouble centerz,GLdouble upx,GLdouble upy,GLdouble upz );

It takes three sets of arguments, which specify the location of the viewpoint, define a reference point toward which the camera is aimed, and indicate which direction is up. The first three numbers represent where the camera is positioned.

The  next  three  values  represent  where  we  want  the  camera  to  look.  The last three values tell  OpenGL which direction represents up (that is, the direction from the bottom to the top of the viewing volume).