You are not pointing the camera at the ball. You are looking at {0, 0, 10} but the ball's initial position is at {0, 0.4, 0.8}. Change the lookat point (param 4-6) to something like {0, 0, 0}, so you are looking near the ball, i.e:
gluLookAt(
// eye position:
0.0, 2.0, -3.0,
// look at point (this was wrong)
0.0, 0.0, 0.0,
// up-vector
0.0, 1.0, 0.0);
or even better, use the ball's position directly for the lookat point, this will move the camera each frame to point to the ball:
gluLookAt(
// eye position:
0.0, 2.0, -3.0,
// look at point, look at the ball each frame
golfball.getpx(), golfball.getpy(), golfball.getpz(),
// up-vector
0.0, 1.0, 0.0);
But for this to work, you have to fix the rendering of the ball's position, remove startdispzotherwise you are not redering the ball on the correct position, change it to:
glTranslatef(golfball.getpx(),golfball.getpy(), golfball.getpz());
glutSolidSphere(golfball.getballsize(),20,20);