The surface of revolution is created with the shape determined by a Bezier spline. The control points for the spline are stored in the array coordinates. The tutorial Bezier Spline discusses how quad strips are used in the creation of a surface of revolution. In turn, you are referred to that tutorial for an overview on how the code given here works.