this is related to The LookAt target location doesn't matter if it is z = 0 or z = 1000 or -1000?
I tried
gluLookAt(512, 384, 2000,
The first two parameters of gluLookAt are the camera position and the camera target. With just those two the camera isn't fully constrained. Imagine standing somewhere holding a camera. You can hold the camera horizontally to take a landscape picture, or you could hold the camera vertically to take a portrait picture. In both cases, the position of the camera and the position of the subject of the picture are the same. You could rotate the camera to any angle and those two values don't change. The third parameter, the up vector, selects the orientation of the camera.