glEnd();
- /* Cover each stack with a quad strip, except the top stack */
-
- for( i=0; i<stacks-1; i++ )
+ /* Cover each stack with a triangle strip */
+ for( i=0; i<stacks; i++ )
{
- glBegin(GL_QUAD_STRIP);
+ glBegin(GL_TRIANGLE_STRIP);
for(j=0; j<=slices; j++)
{
glEnd();
}
- /* The top stack is covered with individual triangles */
-
- glBegin(GL_TRIANGLES);
-
- glNormal3f(cost[0]*sinn, sint[0]*sinn, cosn);
-
- for (j=0; j<slices; j++)
- {
- glVertex3f(cost[j+0]*r0, sint[j+0]*r0, z0 );
- glVertex3f(0, 0, (GLfloat)height);
- glNormal3f(cost[j+1]*sinn, sint[j+1]*sinn, cosn );
- glVertex3f(cost[j+1]*r0, sint[j+1]*r0, z0 );
- }
-
- glEnd();
-
/* Release sin and cos tables */
free(sint);
if (i==stacks)
z1 = (GLfloat)height;
- glBegin(GL_QUAD_STRIP);
+ glBegin(GL_TRIANGLE_STRIP);
for (j=0; j<=slices; j++ )
{
glNormal3f(cost[j], sint[j], 0 );