We are using the same display function as in the example MorphingWithIdleFunc. In particular, we see from the constant in the call to glBegin that our geometry is that of a triangle fan. The fan point (first point) is at the center of the projection window. The remaining 13 points of the fan can be thought of as being on lines radiating from the fan point and at angles of 0, 30, 60, 90, .. 360 degrees. The first and last of these 13 points are the same since the sine and cosine of 0 and 360 degrees are equal. Therefore, we see only 12 points in our image.

The twelve points are divided into two sets by alternating between the points. We also think of the two sets as points distributed around two concentric circles. Our animation is accomplished by varying the radii of the two circles from 0.25 to 1.0. Also, as the radius of one circle decreases, the other increases. Varying these numbers is done by varying count in the factor count/numberOfPartitions that multiplies the difference 1.0 = 0.25 = 0.75.

We compute the x,y coordinates of the points used in the calls to glVertex by converting polar coordinates to rectangular coordinates, namely,
       x = radius*cos(angle)
       y = radius*sin(angle)
We have also animated the color of the star by varying the rgb components of the vertices. We first set the color of the center (fan point) to a light gray. Next, we make the color of each vertex dependent on the factor count/numberOfPartitions, which of course is varying as the animation progresses. Note that this number varies from 0 to 1 and back, which in turn is in the range of the three rgb values.