-
- fghGenerateTorus(
- dInnerRadius, dOuterRadius, nSides, nRings, /* input */
- &vertex, &normal, &nVert /* output */
- );
-
-
- for( i=0; i<nSides; i++ )
- {
- int offset;
-
- int ioff = 3;
- if (i==nSides-1)
- ioff = -i*3;
-
- glBegin( GL_TRIANGLE_STRIP );
- for( j=0; j<nRings; j++ )
- {
- offset = 3 * ( j * nSides + i ) ;
- glNormal3fv( normal + offset );
- glVertex3fv( vertex + offset );
- glNormal3fv( normal + offset + ioff );
- glVertex3fv( vertex + offset + ioff );
- }
- /* repeat first to close off shape */
- offset = 3 * i;
- glNormal3fv( normal + offset );
- glVertex3fv( vertex + offset );
- glNormal3fv( normal + offset + ioff );
- glVertex3fv( vertex + offset + ioff );
- glEnd();
- }
-
- free ( vertex ) ;
- free ( normal ) ;
+ fghTorus(dInnerRadius, dOuterRadius, nSides, nRings, FALSE);