In my little game i want to be able to look at a specific point in my 3d scene. If my camera is at (0, 0, 0) and i want to be able to look at (10, 0, 20) how would i do this.
I understand that i need to change the gluLookAt() function. Which basically sets the camera's (eye, center, up). The Eye is the location of the camera, center is the direction the camera is pointing and up is defining what up is. So would i have to do something like this?
gluLookAt(0.0, 0.0, 0.0, 10.0, 0.0, 20.0, 0.0, 1.0, 0.0);
This will Make
eye.x = 0.0, eye.y = 0.0, eye.z = 0.0
center.x = 10.0, center.y = 0.0, center.z = 20.0
up.x = 0.0, up.y = 1.0, up.z = 0.0
That means the camera will be at the origin and looking at the point (10.0, 0.0, 20.0). Am i correct?
So if i want to look at a specific point all i would have to do is change the center to that point?