for( j=0; j<stacks-1; j++ )
{
- cpsi = cos ( psi ) ;
- spsi = sin ( psi ) ;
+ cpsi = cos ( psi );
+ spsi = sin ( psi );
phi = 0.0;
for( i=0; i<slices; i++ )
{
- int offset = 3 * ( j * slices + i ) ;
- cphi = cos ( phi ) ;
- sphi = sin ( phi ) ;
+ int offset = 3 * ( j * slices + i );
+ cphi = cos ( phi );
+ sphi = sin ( phi );
*(vertex + offset + 0) = sphi * spsi ;
*(vertex + offset + 1) = cphi * spsi ;
*(vertex + offset + 2) = cpsi ;
for( j=0; j<stacks - 1; j++ )
{
- int offset = 3 * ( j * slices + i ) ;
+ int offset = 3 * ( j * slices + i );
glNormal3dv( vertex + offset );
glVertex3dv( vertex + offset );
}
for( i=0; i<slices; i++ )
{
- int offset = 3 * ( j * slices + i ) ;
+ int offset = 3 * ( j * slices + i );
glNormal3dv( vertex + offset );
glVertex3dv( vertex + offset );
}
{
phi = 0.0;
psi += dpsi;
- cpsi = cos ( psi ) ;
- spsi = sin ( psi ) ;
+ cpsi = cos ( psi );
+ spsi = sin ( psi );
/* get coords */
glBegin( GL_QUAD_STRIP );
/* glBegin(GL_LINE_LOOP); */
for( i=0; i<slices; i++ )
{
- cphi = cos ( phi ) ;
- sphi = sin ( phi ) ;
+ cphi = cos ( phi );
+ sphi = sin ( phi );
next[ i * 3 + 0 ] = sphi * spsi ;
next[ i * 3 + 1 ] = cphi * spsi ;
next[ i * 3 + 2 ] = cpsi ;
double angle = M_PI / (double) slices * 2.0;
double slope = ( height / base );
double sBase = base ;
- double sinNormal = ( base / sqrt ( height * height + base * base )) ;
- double cosNormal = ( height / sqrt ( height * height + base * base )) ;
+ double sinNormal = ( base / sqrt ( height * height + base * base ));
+ double cosNormal = ( height / sqrt ( height * height + base * base ));
double *vertices = NULL;
int i, j;
for( j=0; j<slices; j++ )
{
glBegin( GL_LINE_LOOP );
- glNormal3d( sinNormal * vertices[(j+0)*2+0], sinNormal * vertices[(j+0)*2+1], cosNormal ) ;
+ glNormal3d( sinNormal * vertices[(j+0)*2+0], sinNormal * vertices[(j+0)*2+1], cosNormal );
glVertex3d( vertices[(j+0)*2+0] * scl_a, vertices[(j+0)*2+1] * scl_a, alt_a );
- glNormal3d( sinNormal * vertices[(j+1)*2+0], sinNormal * vertices[(j+1)*2+1], cosNormal ) ;
+ glNormal3d( sinNormal * vertices[(j+1)*2+0], sinNormal * vertices[(j+1)*2+1], cosNormal );
glVertex3d( vertices[(j+1)*2+0] * scl_a, vertices[(j+1)*2+1] * scl_a, alt_a );
- glNormal3d( sinNormal * vertices[(j+0)*2+0], sinNormal * vertices[(j+0)*2+1], cosNormal ) ;
+ glNormal3d( sinNormal * vertices[(j+0)*2+0], sinNormal * vertices[(j+0)*2+1], cosNormal );
glVertex3d( vertices[(j+0)*2+0] * scl_b, vertices[(j+0)*2+1] * scl_b, alt_b );
glEnd();
glBegin( GL_LINE_LOOP );
- glNormal3d( sinNormal * vertices[(j+0)*2+0], sinNormal * vertices[(j+0)*2+1], cosNormal ) ;
+ glNormal3d( sinNormal * vertices[(j+0)*2+0], sinNormal * vertices[(j+0)*2+1], cosNormal );
glVertex3d( vertices[(j+0)*2+0] * scl_b, vertices[(j+0)*2+1] * scl_b, alt_b );
- glNormal3d( sinNormal * vertices[(j+1)*2+0], sinNormal * vertices[(j+1)*2+1], cosNormal ) ;
+ glNormal3d( sinNormal * vertices[(j+1)*2+0], sinNormal * vertices[(j+1)*2+1], cosNormal );
glVertex3d( vertices[(j+1)*2+0] * scl_b, vertices[(j+1)*2+1] * scl_b, alt_b );
glVertex3d( vertices[(j+1)*2+0] * scl_a, vertices[(j+1)*2+1] * scl_a, alt_a );
glEnd();
double scl = alt / slope;
glBegin( GL_LINE_LOOP );
- glNormal3d( sinNormal * vertices[(j+0)*2+0], sinNormal * vertices[(j+0)*2+1], cosNormal ) ;
+ glNormal3d( sinNormal * vertices[(j+0)*2+0], sinNormal * vertices[(j+0)*2+1], cosNormal );
glVertex3d( vertices[ (j+0)*2+0 ] * scl, vertices[ (j+0)*2+1 ] * scl, height - alt );
- glNormal3d( sinNormal * vertices[(j+1)*2+0], sinNormal * vertices[(j+1)*2+1], cosNormal ) ;
+ glNormal3d( sinNormal * vertices[(j+1)*2+0], sinNormal * vertices[(j+1)*2+1], cosNormal );
glVertex3d( vertices[ (j+1)*2+0 ] * scl, vertices[ (j+1)*2+1 ] * scl, height - alt );
glVertex3d( 0, 0, height );
glEnd();
double angle = M_PI / (double) slices * 2.0f;
double slope = ( height / base );
double sBase = base ;
- double sinNormal = ( base / sqrt ( height * height + base * base )) ;
- double cosNormal = ( height / sqrt ( height * height + base * base )) ;
+ double sinNormal = ( base / sqrt ( height * height + base * base ));
+ double cosNormal = ( height / sqrt ( height * height + base * base ));
double *vertices = NULL;
int i, j;
for( j=0; j<slices; j++ )
{
glBegin( GL_TRIANGLES );
- glNormal3d( sinNormal * vertices[(j+0)*2+0], sinNormal * vertices[(j+0)*2+1], cosNormal ) ;
+ glNormal3d( sinNormal * vertices[(j+0)*2+0], sinNormal * vertices[(j+0)*2+1], cosNormal );
glVertex3d( vertices[(j+0)*2+0] * scl_a, vertices[(j+0)*2+1] * scl_a, alt_a );
- glNormal3d( sinNormal * vertices[(j+1)*2+0], sinNormal * vertices[(j+1)*2+1], cosNormal ) ;
+ glNormal3d( sinNormal * vertices[(j+1)*2+0], sinNormal * vertices[(j+1)*2+1], cosNormal );
glVertex3d( vertices[(j+1)*2+0] * scl_a, vertices[(j+1)*2+1] * scl_a, alt_a );
- glNormal3d( sinNormal * vertices[(j+0)*2+0], sinNormal * vertices[(j+0)*2+1], cosNormal ) ;
+ glNormal3d( sinNormal * vertices[(j+0)*2+0], sinNormal * vertices[(j+0)*2+1], cosNormal );
glVertex3d( vertices[(j+0)*2+0] * scl_b, vertices[(j+0)*2+1] * scl_b, alt_b );
glEnd();
glBegin( GL_TRIANGLES );
- glNormal3d( sinNormal * vertices[(j+0)*2+0], sinNormal * vertices[(j+0)*2+1], cosNormal ) ;
+ glNormal3d( sinNormal * vertices[(j+0)*2+0], sinNormal * vertices[(j+0)*2+1], cosNormal );
glVertex3d( vertices[(j+0)*2+0] * scl_b, vertices[(j+0)*2+1] * scl_b, alt_b );
- glNormal3d( sinNormal * vertices[(j+1)*2+0], sinNormal * vertices[(j+1)*2+1], cosNormal ) ;
+ glNormal3d( sinNormal * vertices[(j+1)*2+0], sinNormal * vertices[(j+1)*2+1], cosNormal );
glVertex3d( vertices[(j+1)*2+0] * scl_b, vertices[(j+1)*2+1] * scl_b, alt_b );
glVertex3d( vertices[(j+1)*2+0] * scl_a, vertices[(j+1)*2+1] * scl_a, alt_a );
glEnd();
double scl = alt / slope;
glBegin( GL_TRIANGLES );
- glNormal3d( sinNormal * vertices[(j+0)*2+0], sinNormal * vertices[(j+0)*2+1], cosNormal ) ;
+ glNormal3d( sinNormal * vertices[(j+0)*2+0], sinNormal * vertices[(j+0)*2+1], cosNormal );
glVertex3d( vertices[ (j+0)*2+0 ] * scl, vertices[ (j+0)*2+1 ] * scl, height - alt );
- glNormal3d( sinNormal * vertices[(j+1)*2+0], sinNormal * vertices[(j+1)*2+1], cosNormal ) ;
+ glNormal3d( sinNormal * vertices[(j+1)*2+0], sinNormal * vertices[(j+1)*2+1], cosNormal );
glVertex3d( vertices[ (j+1)*2+0 ] * scl, vertices[ (j+1)*2+1 ] * scl, height - alt );
glVertex3d( 0, 0, height );
glEnd();
for( j=0; j<nRings; j++ )
{
- cpsi = cos ( psi ) ;
- spsi = sin ( psi ) ;
+ cpsi = cos ( psi );
+ spsi = sin ( psi );
phi = 0.0;
for( i=0; i<nSides; i++ )
{
- int offset = 3 * ( j * nSides + i ) ;
- cphi = cos ( phi ) ;
- sphi = sin ( phi ) ;
- *(vertex + offset + 0) = cpsi * ( oradius + cphi * iradius ) ;
- *(vertex + offset + 1) = spsi * ( oradius + cphi * iradius ) ;
- *(vertex + offset + 2) = sphi * iradius ;
- *(normal + offset + 0) = cpsi * cphi ;
- *(normal + offset + 1) = spsi * cphi ;
- *(normal + offset + 2) = sphi ;
+ int offset = 3 * ( j * nSides + i );
+ cphi = cos ( phi );
+ sphi = sin ( phi );
+ *(vertex + offset + 0) = cpsi * ( oradius + cphi * iradius );
+ *(vertex + offset + 1) = spsi * ( oradius + cphi * iradius );
+ *(vertex + offset + 2) = sphi * iradius ;
+ *(normal + offset + 0) = cpsi * cphi;
+ *(normal + offset + 1) = spsi * cphi;
+ *(normal + offset + 2) = sphi;
phi += dphi;
}
for( j=0; j<nRings; j++ )
{
- int offset = 3 * ( j * nSides + i ) ;
+ int offset = 3 * ( j * nSides + i );
glNormal3dv( normal + offset );
glVertex3dv( vertex + offset );
}
for( i=0; i<nSides; i++ )
{
- int offset = 3 * ( j * nSides + i ) ;
+ int offset = 3 * ( j * nSides + i );
glNormal3dv( normal + offset );
glVertex3dv( vertex + offset );
}
glEnd();
}
- free ( vertex ) ;
- free ( normal ) ;
+ free ( vertex );
+ free ( normal );
glPopMatrix();
}
/*
* Increment the number of sides and rings to allow for one more point than surface
*/
- nSides ++ ;
- nRings ++ ;
+ nSides ++;
+ nRings ++;
/*
* Allocate the vertices array
glPushMatrix();
- dpsi = 2.0 * M_PI / (double)(nRings - 1) ;
- dphi = 2.0 * M_PI / (double)(nSides - 1) ;
+ dpsi = 2.0 * M_PI / (double)(nRings - 1);
+ dphi = 2.0 * M_PI / (double)(nSides - 1);
psi = 0.0;
for( j=0; j<nRings; j++ )
{
- cpsi = cos ( psi ) ;
- spsi = sin ( psi ) ;
+ cpsi = cos ( psi );
+ spsi = sin ( psi );
phi = 0.0;
for( i=0; i<nSides; i++ )
{
- int offset = 3 * ( j * nSides + i ) ;
- cphi = cos ( phi ) ;
- sphi = sin ( phi ) ;
- *(vertex + offset + 0) = cpsi * ( oradius + cphi * iradius ) ;
- *(vertex + offset + 1) = spsi * ( oradius + cphi * iradius ) ;
- *(vertex + offset + 2) = sphi * iradius ;
- *(normal + offset + 0) = cpsi * cphi ;
- *(normal + offset + 1) = spsi * cphi ;
- *(normal + offset + 2) = sphi ;
+ int offset = 3 * ( j * nSides + i );
+ cphi = cos ( phi );
+ sphi = sin ( phi );
+ *(vertex + offset + 0) = cpsi * ( oradius + cphi * iradius );
+ *(vertex + offset + 1) = spsi * ( oradius + cphi * iradius );
+ *(vertex + offset + 2) = sphi * iradius ;
+ *(normal + offset + 0) = cpsi * cphi;
+ *(normal + offset + 1) = spsi * cphi;
+ *(normal + offset + 2) = sphi;
phi += dphi;
}
{
for( j=0; j<nRings-1; j++ )
{
- int offset = 3 * ( j * nSides + i ) ;
+ int offset = 3 * ( j * nSides + i );
glNormal3dv( normal + offset );
glVertex3dv( vertex + offset );
glNormal3dv( normal + offset + 3 );
glEnd();
- free ( vertex ) ;
- free ( normal ) ;
+ free ( vertex );
+ free ( normal );
glPopMatrix();
}
* (+-x,0, z); (+-1, 1, 1); (0, z, x )
* where x = 0.61803398875 and z = 1.61803398875.
*/
- glBegin ( GL_LINE_LOOP ) ;
- glNormal3d ( 0.0, 0.525731112119, 0.850650808354 ) ; glVertex3d ( 0.0, 1.61803398875, 0.61803398875 ) ; glVertex3d ( -1.0, 1.0, 1.0 ) ; glVertex3d ( -0.61803398875, 0.0, 1.61803398875 ) ; glVertex3d ( 0.61803398875, 0.0, 1.61803398875 ) ; glVertex3d ( 1.0, 1.0, 1.0 ) ;
- glEnd () ;
- glBegin ( GL_LINE_LOOP ) ;
- glNormal3d ( 0.0, 0.525731112119, -0.850650808354 ) ; glVertex3d ( 0.0, 1.61803398875, -0.61803398875 ) ; glVertex3d ( 1.0, 1.0, -1.0 ) ; glVertex3d ( 0.61803398875, 0.0, -1.61803398875 ) ; glVertex3d ( -0.61803398875, 0.0, -1.61803398875 ) ; glVertex3d ( -1.0, 1.0, -1.0 ) ;
- glEnd () ;
- glBegin ( GL_LINE_LOOP ) ;
- glNormal3d ( 0.0, -0.525731112119, 0.850650808354 ) ; glVertex3d ( 0.0, -1.61803398875, 0.61803398875 ) ; glVertex3d ( 1.0, -1.0, 1.0 ) ; glVertex3d ( 0.61803398875, 0.0, 1.61803398875 ) ; glVertex3d ( -0.61803398875, 0.0, 1.61803398875 ) ; glVertex3d ( -1.0, -1.0, 1.0 ) ;
- glEnd () ;
- glBegin ( GL_LINE_LOOP ) ;
- glNormal3d ( 0.0, -0.525731112119, -0.850650808354 ) ; glVertex3d ( 0.0, -1.61803398875, -0.61803398875 ) ; glVertex3d ( -1.0, -1.0, -1.0 ) ; glVertex3d ( -0.61803398875, 0.0, -1.61803398875 ) ; glVertex3d ( 0.61803398875, 0.0, -1.61803398875 ) ; glVertex3d ( 1.0, -1.0, -1.0 ) ;
- glEnd () ;
-
- glBegin ( GL_LINE_LOOP ) ;
- glNormal3d ( 0.850650808354, 0.0, 0.525731112119 ) ; glVertex3d ( 0.61803398875, 0.0, 1.61803398875 ) ; glVertex3d ( 1.0, -1.0, 1.0 ) ; glVertex3d ( 1.61803398875, -0.61803398875, 0.0 ) ; glVertex3d ( 1.61803398875, 0.61803398875, 0.0 ) ; glVertex3d ( 1.0, 1.0, 1.0 ) ;
- glEnd () ;
- glBegin ( GL_LINE_LOOP ) ;
- glNormal3d ( -0.850650808354, 0.0, 0.525731112119 ) ; glVertex3d ( -0.61803398875, 0.0, 1.61803398875 ) ; glVertex3d ( -1.0, 1.0, 1.0 ) ; glVertex3d ( -1.61803398875, 0.61803398875, 0.0 ) ; glVertex3d ( -1.61803398875, -0.61803398875, 0.0 ) ; glVertex3d ( -1.0, -1.0, 1.0 ) ;
- glEnd () ;
- glBegin ( GL_LINE_LOOP ) ;
- glNormal3d ( 0.850650808354, 0.0, -0.525731112119 ) ; glVertex3d ( 0.61803398875, 0.0, -1.61803398875 ) ; glVertex3d ( 1.0, 1.0, -1.0 ) ; glVertex3d ( 1.61803398875, 0.61803398875, 0.0 ) ; glVertex3d ( 1.61803398875, -0.61803398875, 0.0 ) ; glVertex3d ( 1.0, -1.0, -1.0 ) ;
- glEnd () ;
- glBegin ( GL_LINE_LOOP ) ;
- glNormal3d ( -0.850650808354, 0.0, -0.525731112119 ) ; glVertex3d ( -0.61803398875, 0.0, -1.61803398875 ) ; glVertex3d ( -1.0, -1.0, -1.0 ) ; glVertex3d ( -1.61803398875, -0.61803398875, 0.0 ) ; glVertex3d ( -1.61803398875, 0.61803398875, 0.0 ) ; glVertex3d ( -1.0, 1.0, -1.0 ) ;
- glEnd () ;
-
- glBegin ( GL_LINE_LOOP ) ;
- glNormal3d ( 0.525731112119, 0.850650808354, 0.0 ) ; glVertex3d ( 1.61803398875, 0.61803398875, 0.0 ) ; glVertex3d ( 1.0, 1.0, -1.0 ) ; glVertex3d ( 0.0, 1.61803398875, -0.61803398875 ) ; glVertex3d ( 0.0, 1.61803398875, 0.61803398875 ) ; glVertex3d ( 1.0, 1.0, 1.0 ) ;
- glEnd () ;
- glBegin ( GL_LINE_LOOP ) ;
- glNormal3d ( 0.525731112119, -0.850650808354, 0.0 ) ; glVertex3d ( 1.61803398875, -0.61803398875, 0.0 ) ; glVertex3d ( 1.0, -1.0, 1.0 ) ; glVertex3d ( 0.0, -1.61803398875, 0.61803398875 ) ; glVertex3d ( 0.0, -1.61803398875, -0.61803398875 ) ; glVertex3d ( 1.0, -1.0, -1.0 ) ;
- glEnd () ;
- glBegin ( GL_LINE_LOOP ) ;
- glNormal3d ( -0.525731112119, 0.850650808354, 0.0 ) ; glVertex3d ( -1.61803398875, 0.61803398875, 0.0 ) ; glVertex3d ( -1.0, 1.0, 1.0 ) ; glVertex3d ( 0.0, 1.61803398875, 0.61803398875 ) ; glVertex3d ( 0.0, 1.61803398875, -0.61803398875 ) ; glVertex3d ( -1.0, 1.0, -1.0 ) ;
- glEnd () ;
- glBegin ( GL_LINE_LOOP ) ;
- glNormal3d ( -0.525731112119, -0.850650808354, 0.0 ) ; glVertex3d ( -1.61803398875, -0.61803398875, 0.0 ) ; glVertex3d ( -1.0, -1.0, -1.0 ) ; glVertex3d ( 0.0, -1.61803398875, -0.61803398875 ) ; glVertex3d ( 0.0, -1.61803398875, 0.61803398875 ) ; glVertex3d ( -1.0, -1.0, 1.0 ) ;
- glEnd () ;
+ glBegin ( GL_LINE_LOOP );
+ glNormal3d ( 0.0, 0.525731112119, 0.850650808354 ); glVertex3d ( 0.0, 1.61803398875, 0.61803398875 ); glVertex3d ( -1.0, 1.0, 1.0 ); glVertex3d ( -0.61803398875, 0.0, 1.61803398875 ); glVertex3d ( 0.61803398875, 0.0, 1.61803398875 ); glVertex3d ( 1.0, 1.0, 1.0 );
+ glEnd ();
+ glBegin ( GL_LINE_LOOP );
+ glNormal3d ( 0.0, 0.525731112119, -0.850650808354 ); glVertex3d ( 0.0, 1.61803398875, -0.61803398875 ); glVertex3d ( 1.0, 1.0, -1.0 ); glVertex3d ( 0.61803398875, 0.0, -1.61803398875 ); glVertex3d ( -0.61803398875, 0.0, -1.61803398875 ); glVertex3d ( -1.0, 1.0, -1.0 );
+ glEnd ();
+ glBegin ( GL_LINE_LOOP );
+ glNormal3d ( 0.0, -0.525731112119, 0.850650808354 ); glVertex3d ( 0.0, -1.61803398875, 0.61803398875 ); glVertex3d ( 1.0, -1.0, 1.0 ); glVertex3d ( 0.61803398875, 0.0, 1.61803398875 ); glVertex3d ( -0.61803398875, 0.0, 1.61803398875 ); glVertex3d ( -1.0, -1.0, 1.0 );
+ glEnd ();
+ glBegin ( GL_LINE_LOOP );
+ glNormal3d ( 0.0, -0.525731112119, -0.850650808354 ); glVertex3d ( 0.0, -1.61803398875, -0.61803398875 ); glVertex3d ( -1.0, -1.0, -1.0 ); glVertex3d ( -0.61803398875, 0.0, -1.61803398875 ); glVertex3d ( 0.61803398875, 0.0, -1.61803398875 ); glVertex3d ( 1.0, -1.0, -1.0 );
+ glEnd ();
+
+ glBegin ( GL_LINE_LOOP );
+ glNormal3d ( 0.850650808354, 0.0, 0.525731112119 ); glVertex3d ( 0.61803398875, 0.0, 1.61803398875 ); glVertex3d ( 1.0, -1.0, 1.0 ); glVertex3d ( 1.61803398875, -0.61803398875, 0.0 ); glVertex3d ( 1.61803398875, 0.61803398875, 0.0 ); glVertex3d ( 1.0, 1.0, 1.0 );
+ glEnd ();
+ glBegin ( GL_LINE_LOOP );
+ glNormal3d ( -0.850650808354, 0.0, 0.525731112119 ); glVertex3d ( -0.61803398875, 0.0, 1.61803398875 ); glVertex3d ( -1.0, 1.0, 1.0 ); glVertex3d ( -1.61803398875, 0.61803398875, 0.0 ); glVertex3d ( -1.61803398875, -0.61803398875, 0.0 ); glVertex3d ( -1.0, -1.0, 1.0 );
+ glEnd ();
+ glBegin ( GL_LINE_LOOP );
+ glNormal3d ( 0.850650808354, 0.0, -0.525731112119 ); glVertex3d ( 0.61803398875, 0.0, -1.61803398875 ); glVertex3d ( 1.0, 1.0, -1.0 ); glVertex3d ( 1.61803398875, 0.61803398875, 0.0 ); glVertex3d ( 1.61803398875, -0.61803398875, 0.0 ); glVertex3d ( 1.0, -1.0, -1.0 );
+ glEnd ();
+ glBegin ( GL_LINE_LOOP );
+ glNormal3d ( -0.850650808354, 0.0, -0.525731112119 ); glVertex3d ( -0.61803398875, 0.0, -1.61803398875 ); glVertex3d ( -1.0, -1.0, -1.0 ); glVertex3d ( -1.61803398875, -0.61803398875, 0.0 ); glVertex3d ( -1.61803398875, 0.61803398875, 0.0 ); glVertex3d ( -1.0, 1.0, -1.0 );
+ glEnd ();
+
+ glBegin ( GL_LINE_LOOP );
+ glNormal3d ( 0.525731112119, 0.850650808354, 0.0 ); glVertex3d ( 1.61803398875, 0.61803398875, 0.0 ); glVertex3d ( 1.0, 1.0, -1.0 ); glVertex3d ( 0.0, 1.61803398875, -0.61803398875 ); glVertex3d ( 0.0, 1.61803398875, 0.61803398875 ); glVertex3d ( 1.0, 1.0, 1.0 );
+ glEnd ();
+ glBegin ( GL_LINE_LOOP );
+ glNormal3d ( 0.525731112119, -0.850650808354, 0.0 ); glVertex3d ( 1.61803398875, -0.61803398875, 0.0 ); glVertex3d ( 1.0, -1.0, 1.0 ); glVertex3d ( 0.0, -1.61803398875, 0.61803398875 ); glVertex3d ( 0.0, -1.61803398875, -0.61803398875 ); glVertex3d ( 1.0, -1.0, -1.0 );
+ glEnd ();
+ glBegin ( GL_LINE_LOOP );
+ glNormal3d ( -0.525731112119, 0.850650808354, 0.0 ); glVertex3d ( -1.61803398875, 0.61803398875, 0.0 ); glVertex3d ( -1.0, 1.0, 1.0 ); glVertex3d ( 0.0, 1.61803398875, 0.61803398875 ); glVertex3d ( 0.0, 1.61803398875, -0.61803398875 ); glVertex3d ( -1.0, 1.0, -1.0 );
+ glEnd ();
+ glBegin ( GL_LINE_LOOP );
+ glNormal3d ( -0.525731112119, -0.850650808354, 0.0 ); glVertex3d ( -1.61803398875, -0.61803398875, 0.0 ); glVertex3d ( -1.0, -1.0, -1.0 ); glVertex3d ( 0.0, -1.61803398875, -0.61803398875 ); glVertex3d ( 0.0, -1.61803398875, 0.61803398875 ); glVertex3d ( -1.0, -1.0, 1.0 );
+ glEnd ();
}
/*
* (+-x,0, z); (+-1, 1, 1); (0, z, x )
* where x = 0.61803398875 and z = 1.61803398875.
*/
- glBegin ( GL_POLYGON ) ;
- glNormal3d ( 0.0, 0.525731112119, 0.850650808354 ) ; glVertex3d ( 0.0, 1.61803398875, 0.61803398875 ) ; glVertex3d ( -1.0, 1.0, 1.0 ) ; glVertex3d ( -0.61803398875, 0.0, 1.61803398875 ) ; glVertex3d ( 0.61803398875, 0.0, 1.61803398875 ) ; glVertex3d ( 1.0, 1.0, 1.0 ) ;
- glEnd () ;
- glBegin ( GL_POLYGON ) ;
- glNormal3d ( 0.0, 0.525731112119, -0.850650808354 ) ; glVertex3d ( 0.0, 1.61803398875, -0.61803398875 ) ; glVertex3d ( 1.0, 1.0, -1.0 ) ; glVertex3d ( 0.61803398875, 0.0, -1.61803398875 ) ; glVertex3d ( -0.61803398875, 0.0, -1.61803398875 ) ; glVertex3d ( -1.0, 1.0, -1.0 ) ;
- glEnd () ;
- glBegin ( GL_POLYGON ) ;
- glNormal3d ( 0.0, -0.525731112119, 0.850650808354 ) ; glVertex3d ( 0.0, -1.61803398875, 0.61803398875 ) ; glVertex3d ( 1.0, -1.0, 1.0 ) ; glVertex3d ( 0.61803398875, 0.0, 1.61803398875 ) ; glVertex3d ( -0.61803398875, 0.0, 1.61803398875 ) ; glVertex3d ( -1.0, -1.0, 1.0 ) ;
- glEnd () ;
- glBegin ( GL_POLYGON ) ;
- glNormal3d ( 0.0, -0.525731112119, -0.850650808354 ) ; glVertex3d ( 0.0, -1.61803398875, -0.61803398875 ) ; glVertex3d ( -1.0, -1.0, -1.0 ) ; glVertex3d ( -0.61803398875, 0.0, -1.61803398875 ) ; glVertex3d ( 0.61803398875, 0.0, -1.61803398875 ) ; glVertex3d ( 1.0, -1.0, -1.0 ) ;
- glEnd () ;
-
- glBegin ( GL_POLYGON ) ;
- glNormal3d ( 0.850650808354, 0.0, 0.525731112119 ) ; glVertex3d ( 0.61803398875, 0.0, 1.61803398875 ) ; glVertex3d ( 1.0, -1.0, 1.0 ) ; glVertex3d ( 1.61803398875, -0.61803398875, 0.0 ) ; glVertex3d ( 1.61803398875, 0.61803398875, 0.0 ) ; glVertex3d ( 1.0, 1.0, 1.0 ) ;
- glEnd () ;
- glBegin ( GL_POLYGON ) ;
- glNormal3d ( -0.850650808354, 0.0, 0.525731112119 ) ; glVertex3d ( -0.61803398875, 0.0, 1.61803398875 ) ; glVertex3d ( -1.0, 1.0, 1.0 ) ; glVertex3d ( -1.61803398875, 0.61803398875, 0.0 ) ; glVertex3d ( -1.61803398875, -0.61803398875, 0.0 ) ; glVertex3d ( -1.0, -1.0, 1.0 ) ;
- glEnd () ;
- glBegin ( GL_POLYGON ) ;
- glNormal3d ( 0.850650808354, 0.0, -0.525731112119 ) ; glVertex3d ( 0.61803398875, 0.0, -1.61803398875 ) ; glVertex3d ( 1.0, 1.0, -1.0 ) ; glVertex3d ( 1.61803398875, 0.61803398875, 0.0 ) ; glVertex3d ( 1.61803398875, -0.61803398875, 0.0 ) ; glVertex3d ( 1.0, -1.0, -1.0 ) ;
- glEnd () ;
- glBegin ( GL_POLYGON ) ;
- glNormal3d ( -0.850650808354, 0.0, -0.525731112119 ) ; glVertex3d ( -0.61803398875, 0.0, -1.61803398875 ) ; glVertex3d ( -1.0, -1.0, -1.0 ) ; glVertex3d ( -1.61803398875, -0.61803398875, 0.0 ) ; glVertex3d ( -1.61803398875, 0.61803398875, 0.0 ) ; glVertex3d ( -1.0, 1.0, -1.0 ) ;
- glEnd () ;
-
- glBegin ( GL_POLYGON ) ;
- glNormal3d ( 0.525731112119, 0.850650808354, 0.0 ) ; glVertex3d ( 1.61803398875, 0.61803398875, 0.0 ) ; glVertex3d ( 1.0, 1.0, -1.0 ) ; glVertex3d ( 0.0, 1.61803398875, -0.61803398875 ) ; glVertex3d ( 0.0, 1.61803398875, 0.61803398875 ) ; glVertex3d ( 1.0, 1.0, 1.0 ) ;
- glEnd () ;
- glBegin ( GL_POLYGON ) ;
- glNormal3d ( 0.525731112119, -0.850650808354, 0.0 ) ; glVertex3d ( 1.61803398875, -0.61803398875, 0.0 ) ; glVertex3d ( 1.0, -1.0, 1.0 ) ; glVertex3d ( 0.0, -1.61803398875, 0.61803398875 ) ; glVertex3d ( 0.0, -1.61803398875, -0.61803398875 ) ; glVertex3d ( 1.0, -1.0, -1.0 ) ;
- glEnd () ;
- glBegin ( GL_POLYGON ) ;
- glNormal3d ( -0.525731112119, 0.850650808354, 0.0 ) ; glVertex3d ( -1.61803398875, 0.61803398875, 0.0 ) ; glVertex3d ( -1.0, 1.0, 1.0 ) ; glVertex3d ( 0.0, 1.61803398875, 0.61803398875 ) ; glVertex3d ( 0.0, 1.61803398875, -0.61803398875 ) ; glVertex3d ( -1.0, 1.0, -1.0 ) ;
- glEnd () ;
- glBegin ( GL_POLYGON ) ;
- glNormal3d ( -0.525731112119, -0.850650808354, 0.0 ) ; glVertex3d ( -1.61803398875, -0.61803398875, 0.0 ) ; glVertex3d ( -1.0, -1.0, -1.0 ) ; glVertex3d ( 0.0, -1.61803398875, -0.61803398875 ) ; glVertex3d ( 0.0, -1.61803398875, 0.61803398875 ) ; glVertex3d ( -1.0, -1.0, 1.0 ) ;
- glEnd () ;
+ glBegin ( GL_POLYGON );
+ glNormal3d ( 0.0, 0.525731112119, 0.850650808354 ); glVertex3d ( 0.0, 1.61803398875, 0.61803398875 ); glVertex3d ( -1.0, 1.0, 1.0 ); glVertex3d ( -0.61803398875, 0.0, 1.61803398875 ); glVertex3d ( 0.61803398875, 0.0, 1.61803398875 ); glVertex3d ( 1.0, 1.0, 1.0 );
+ glEnd ();
+ glBegin ( GL_POLYGON );
+ glNormal3d ( 0.0, 0.525731112119, -0.850650808354 ); glVertex3d ( 0.0, 1.61803398875, -0.61803398875 ); glVertex3d ( 1.0, 1.0, -1.0 ); glVertex3d ( 0.61803398875, 0.0, -1.61803398875 ); glVertex3d ( -0.61803398875, 0.0, -1.61803398875 ); glVertex3d ( -1.0, 1.0, -1.0 );
+ glEnd ();
+ glBegin ( GL_POLYGON );
+ glNormal3d ( 0.0, -0.525731112119, 0.850650808354 ); glVertex3d ( 0.0, -1.61803398875, 0.61803398875 ); glVertex3d ( 1.0, -1.0, 1.0 ); glVertex3d ( 0.61803398875, 0.0, 1.61803398875 ); glVertex3d ( -0.61803398875, 0.0, 1.61803398875 ); glVertex3d ( -1.0, -1.0, 1.0 );
+ glEnd ();
+ glBegin ( GL_POLYGON );
+ glNormal3d ( 0.0, -0.525731112119, -0.850650808354 ); glVertex3d ( 0.0, -1.61803398875, -0.61803398875 ); glVertex3d ( -1.0, -1.0, -1.0 ); glVertex3d ( -0.61803398875, 0.0, -1.61803398875 ); glVertex3d ( 0.61803398875, 0.0, -1.61803398875 ); glVertex3d ( 1.0, -1.0, -1.0 );
+ glEnd ();
+
+ glBegin ( GL_POLYGON );
+ glNormal3d ( 0.850650808354, 0.0, 0.525731112119 ); glVertex3d ( 0.61803398875, 0.0, 1.61803398875 ); glVertex3d ( 1.0, -1.0, 1.0 ); glVertex3d ( 1.61803398875, -0.61803398875, 0.0 ); glVertex3d ( 1.61803398875, 0.61803398875, 0.0 ); glVertex3d ( 1.0, 1.0, 1.0 );
+ glEnd ();
+ glBegin ( GL_POLYGON );
+ glNormal3d ( -0.850650808354, 0.0, 0.525731112119 ); glVertex3d ( -0.61803398875, 0.0, 1.61803398875 ); glVertex3d ( -1.0, 1.0, 1.0 ); glVertex3d ( -1.61803398875, 0.61803398875, 0.0 ); glVertex3d ( -1.61803398875, -0.61803398875, 0.0 ); glVertex3d ( -1.0, -1.0, 1.0 );
+ glEnd ();
+ glBegin ( GL_POLYGON );
+ glNormal3d ( 0.850650808354, 0.0, -0.525731112119 ); glVertex3d ( 0.61803398875, 0.0, -1.61803398875 ); glVertex3d ( 1.0, 1.0, -1.0 ); glVertex3d ( 1.61803398875, 0.61803398875, 0.0 ); glVertex3d ( 1.61803398875, -0.61803398875, 0.0 ); glVertex3d ( 1.0, -1.0, -1.0 );
+ glEnd ();
+ glBegin ( GL_POLYGON );
+ glNormal3d ( -0.850650808354, 0.0, -0.525731112119 ); glVertex3d ( -0.61803398875, 0.0, -1.61803398875 ); glVertex3d ( -1.0, -1.0, -1.0 ); glVertex3d ( -1.61803398875, -0.61803398875, 0.0 ); glVertex3d ( -1.61803398875, 0.61803398875, 0.0 ); glVertex3d ( -1.0, 1.0, -1.0 );
+ glEnd ();
+
+ glBegin ( GL_POLYGON );
+ glNormal3d ( 0.525731112119, 0.850650808354, 0.0 ); glVertex3d ( 1.61803398875, 0.61803398875, 0.0 ); glVertex3d ( 1.0, 1.0, -1.0 ); glVertex3d ( 0.0, 1.61803398875, -0.61803398875 ); glVertex3d ( 0.0, 1.61803398875, 0.61803398875 ); glVertex3d ( 1.0, 1.0, 1.0 );
+ glEnd ();
+ glBegin ( GL_POLYGON );
+ glNormal3d ( 0.525731112119, -0.850650808354, 0.0 ); glVertex3d ( 1.61803398875, -0.61803398875, 0.0 ); glVertex3d ( 1.0, -1.0, 1.0 ); glVertex3d ( 0.0, -1.61803398875, 0.61803398875 ); glVertex3d ( 0.0, -1.61803398875, -0.61803398875 ); glVertex3d ( 1.0, -1.0, -1.0 );
+ glEnd ();
+ glBegin ( GL_POLYGON );
+ glNormal3d ( -0.525731112119, 0.850650808354, 0.0 ); glVertex3d ( -1.61803398875, 0.61803398875, 0.0 ); glVertex3d ( -1.0, 1.0, 1.0 ); glVertex3d ( 0.0, 1.61803398875, 0.61803398875 ); glVertex3d ( 0.0, 1.61803398875, -0.61803398875 ); glVertex3d ( -1.0, 1.0, -1.0 );
+ glEnd ();
+ glBegin ( GL_POLYGON );
+ glNormal3d ( -0.525731112119, -0.850650808354, 0.0 ); glVertex3d ( -1.61803398875, -0.61803398875, 0.0 ); glVertex3d ( -1.0, -1.0, -1.0 ); glVertex3d ( 0.0, -1.61803398875, -0.61803398875 ); glVertex3d ( 0.0, -1.61803398875, 0.61803398875 ); glVertex3d ( -1.0, -1.0, 1.0 );
+ glEnd ();
}
/*
* Normals: The unit normals are simply the negative of the coordinates of the point not on the surface.
*/
- double r0[3] = { 1.0, 0.0, 0.0 } ;
- double r1[3] = { -0.333333333333, 0.942809041582, 0.0 } ;
- double r2[3] = { -0.333333333333, -0.471404520791, 0.816496580928 } ;
- double r3[3] = { -0.333333333333, -0.471404520791, -0.816496580928 } ;
-
- glBegin( GL_LINE_LOOP ) ;
- glNormal3d ( -1.0, 0.0, 0.0 ) ; glVertex3dv ( r1 ) ; glVertex3dv ( r3 ) ; glVertex3dv ( r2 ) ;
- glNormal3d ( 0.333333333333, -0.942809041582, 0.0 ) ; glVertex3dv ( r0 ) ; glVertex3dv ( r2 ) ; glVertex3dv ( r3 ) ;
- glNormal3d ( 0.333333333333, 0.471404520791, -0.816496580928 ) ; glVertex3dv ( r0 ) ; glVertex3dv ( r3 ) ; glVertex3dv ( r1 ) ;
- glNormal3d ( 0.333333333333, 0.471404520791, 0.816496580928 ) ; glVertex3dv ( r0 ) ; glVertex3dv ( r1 ) ; glVertex3dv ( r2 ) ;
- glEnd() ;
+ double r0[3] = { 1.0, 0.0, 0.0 };
+ double r1[3] = { -0.333333333333, 0.942809041582, 0.0 };
+ double r2[3] = { -0.333333333333, -0.471404520791, 0.816496580928 };
+ double r3[3] = { -0.333333333333, -0.471404520791, -0.816496580928 };
+
+ glBegin( GL_LINE_LOOP );
+ glNormal3d ( -1.0, 0.0, 0.0 ); glVertex3dv ( r1 ); glVertex3dv ( r3 ); glVertex3dv ( r2 );
+ glNormal3d ( 0.333333333333, -0.942809041582, 0.0 ); glVertex3dv ( r0 ); glVertex3dv ( r2 ); glVertex3dv ( r3 );
+ glNormal3d ( 0.333333333333, 0.471404520791, -0.816496580928 ); glVertex3dv ( r0 ); glVertex3dv ( r3 ); glVertex3dv ( r1 );
+ glNormal3d ( 0.333333333333, 0.471404520791, 0.816496580928 ); glVertex3dv ( r0 ); glVertex3dv ( r1 ); glVertex3dv ( r2 );
+ glEnd();
}
/*
* Normals: The unit normals are simply the negative of the coordinates of the point not on the surface.
*/
- double r0[3] = { 1.0, 0.0, 0.0 } ;
- double r1[3] = { -0.333333333333, 0.942809041582, 0.0 } ;
- double r2[3] = { -0.333333333333, -0.471404520791, 0.816496580928 } ;
- double r3[3] = { -0.333333333333, -0.471404520791, -0.816496580928 } ;
-
- glBegin( GL_TRIANGLES ) ;
- glNormal3d ( -1.0, 0.0, 0.0 ) ; glVertex3dv ( r1 ) ; glVertex3dv ( r3 ) ; glVertex3dv ( r2 ) ;
- glNormal3d ( 0.333333333333, -0.942809041582, 0.0 ) ; glVertex3dv ( r0 ) ; glVertex3dv ( r2 ) ; glVertex3dv ( r3 ) ;
- glNormal3d ( 0.333333333333, 0.471404520791, -0.816496580928 ) ; glVertex3dv ( r0 ) ; glVertex3dv ( r3 ) ; glVertex3dv ( r1 ) ;
- glNormal3d ( 0.333333333333, 0.471404520791, 0.816496580928 ) ; glVertex3dv ( r0 ) ; glVertex3dv ( r1 ) ; glVertex3dv ( r2 ) ;
- glEnd() ;
+ double r0[3] = { 1.0, 0.0, 0.0 };
+ double r1[3] = { -0.333333333333, 0.942809041582, 0.0 };
+ double r2[3] = { -0.333333333333, -0.471404520791, 0.816496580928 };
+ double r3[3] = { -0.333333333333, -0.471404520791, -0.816496580928 };
+
+ glBegin( GL_TRIANGLES );
+ glNormal3d ( -1.0, 0.0, 0.0 ); glVertex3dv ( r1 ); glVertex3dv ( r3 ); glVertex3dv ( r2 );
+ glNormal3d ( 0.333333333333, -0.942809041582, 0.0 ); glVertex3dv ( r0 ); glVertex3dv ( r2 ); glVertex3dv ( r3 );
+ glNormal3d ( 0.333333333333, 0.471404520791, -0.816496580928 ); glVertex3dv ( r0 ); glVertex3dv ( r3 ); glVertex3dv ( r1 );
+ glNormal3d ( 0.333333333333, 0.471404520791, 0.816496580928 ); glVertex3dv ( r0 ); glVertex3dv ( r1 ); glVertex3dv ( r2 );
+ glEnd();
}
/*
double icos_r[12][3] = { { 1.0, 0.0, 0.0 },
{ 0.447213595500, 0.894427191000, 0.0 }, { 0.447213595500, 0.276393202252, 0.850650808354 }, { 0.447213595500, -0.723606797748, 0.525731112119 }, { 0.447213595500, -0.723606797748, -0.525731112119 }, { 0.447213595500, 0.276393202252, -0.850650808354 },
{ -0.447213595500, -0.894427191000, 0.0 }, { -0.447213595500, -0.276393202252, 0.850650808354 }, { -0.447213595500, 0.723606797748, 0.525731112119 }, { -0.447213595500, 0.723606797748, -0.525731112119 }, { -0.447213595500, -0.276393202252, -0.850650808354 },
- { -1.0, 0.0, 0.0 } } ;
+ { -1.0, 0.0, 0.0 } };
int icos_v [20][3] = { { 0, 1, 2 }, { 0, 2, 3 }, { 0, 3, 4 }, { 0, 4, 5 }, { 0, 5, 1 },
{ 1, 8, 2 }, { 2, 7, 3 }, { 3, 6, 4 }, { 4, 10, 5 }, { 5, 9, 1 },
{ 1, 9, 8 }, { 2, 8, 7 }, { 3, 7, 6 }, { 4, 6, 10 }, { 5, 10, 9 },
- { 11, 9, 10 }, { 11, 8, 9 }, { 11, 7, 8 }, { 11, 6, 7 }, { 11, 10, 6 } } ;
+ { 11, 9, 10 }, { 11, 8, 9 }, { 11, 7, 8 }, { 11, 6, 7 }, { 11, 10, 6 } };
void FGAPIENTRY glutWireIcosahedron( void )
{
int i ;
for ( i = 0; i < 20; i++ )
{
- double normal[3] ;
- normal[0] = ( icos_r[icos_v[i][1]][1] - icos_r[icos_v[i][0]][1] ) * ( icos_r[icos_v[i][2]][2] - icos_r[icos_v[i][0]][2] ) - ( icos_r[icos_v[i][1]][2] - icos_r[icos_v[i][0]][2] ) * ( icos_r[icos_v[i][2]][1] - icos_r[icos_v[i][0]][1] ) ;
- normal[1] = ( icos_r[icos_v[i][1]][2] - icos_r[icos_v[i][0]][2] ) * ( icos_r[icos_v[i][2]][0] - icos_r[icos_v[i][0]][0] ) - ( icos_r[icos_v[i][1]][0] - icos_r[icos_v[i][0]][0] ) * ( icos_r[icos_v[i][2]][2] - icos_r[icos_v[i][0]][2] ) ;
- normal[2] = ( icos_r[icos_v[i][1]][0] - icos_r[icos_v[i][0]][0] ) * ( icos_r[icos_v[i][2]][1] - icos_r[icos_v[i][0]][1] ) - ( icos_r[icos_v[i][1]][1] - icos_r[icos_v[i][0]][1] ) * ( icos_r[icos_v[i][2]][0] - icos_r[icos_v[i][0]][0] ) ;
- glBegin ( GL_LINE_LOOP ) ;
- glNormal3dv ( normal ) ;
- glVertex3dv ( icos_r[icos_v[i][0]] ) ;
- glVertex3dv ( icos_r[icos_v[i][1]] ) ;
- glVertex3dv ( icos_r[icos_v[i][2]] ) ;
- glEnd () ;
+ double normal[3];
+ normal[0] = ( icos_r[icos_v[i][1]][1] - icos_r[icos_v[i][0]][1] ) * ( icos_r[icos_v[i][2]][2] - icos_r[icos_v[i][0]][2] ) - ( icos_r[icos_v[i][1]][2] - icos_r[icos_v[i][0]][2] ) * ( icos_r[icos_v[i][2]][1] - icos_r[icos_v[i][0]][1] );
+ normal[1] = ( icos_r[icos_v[i][1]][2] - icos_r[icos_v[i][0]][2] ) * ( icos_r[icos_v[i][2]][0] - icos_r[icos_v[i][0]][0] ) - ( icos_r[icos_v[i][1]][0] - icos_r[icos_v[i][0]][0] ) * ( icos_r[icos_v[i][2]][2] - icos_r[icos_v[i][0]][2] );
+ normal[2] = ( icos_r[icos_v[i][1]][0] - icos_r[icos_v[i][0]][0] ) * ( icos_r[icos_v[i][2]][1] - icos_r[icos_v[i][0]][1] ) - ( icos_r[icos_v[i][1]][1] - icos_r[icos_v[i][0]][1] ) * ( icos_r[icos_v[i][2]][0] - icos_r[icos_v[i][0]][0] );
+ glBegin ( GL_LINE_LOOP );
+ glNormal3dv ( normal );
+ glVertex3dv ( icos_r[icos_v[i][0]] );
+ glVertex3dv ( icos_r[icos_v[i][1]] );
+ glVertex3dv ( icos_r[icos_v[i][2]] );
+ glEnd ();
}
}
{
int i ;
- glBegin ( GL_TRIANGLES ) ;
+ glBegin ( GL_TRIANGLES );
for ( i = 0; i < 20; i++ )
{
- double normal[3] ;
- normal[0] = ( icos_r[icos_v[i][1]][1] - icos_r[icos_v[i][0]][1] ) * ( icos_r[icos_v[i][2]][2] - icos_r[icos_v[i][0]][2] ) - ( icos_r[icos_v[i][1]][2] - icos_r[icos_v[i][0]][2] ) * ( icos_r[icos_v[i][2]][1] - icos_r[icos_v[i][0]][1] ) ;
- normal[1] = ( icos_r[icos_v[i][1]][2] - icos_r[icos_v[i][0]][2] ) * ( icos_r[icos_v[i][2]][0] - icos_r[icos_v[i][0]][0] ) - ( icos_r[icos_v[i][1]][0] - icos_r[icos_v[i][0]][0] ) * ( icos_r[icos_v[i][2]][2] - icos_r[icos_v[i][0]][2] ) ;
- normal[2] = ( icos_r[icos_v[i][1]][0] - icos_r[icos_v[i][0]][0] ) * ( icos_r[icos_v[i][2]][1] - icos_r[icos_v[i][0]][1] ) - ( icos_r[icos_v[i][1]][1] - icos_r[icos_v[i][0]][1] ) * ( icos_r[icos_v[i][2]][0] - icos_r[icos_v[i][0]][0] ) ;
- glNormal3dv ( normal ) ;
- glVertex3dv ( icos_r[icos_v[i][0]] ) ;
- glVertex3dv ( icos_r[icos_v[i][1]] ) ;
- glVertex3dv ( icos_r[icos_v[i][2]] ) ;
+ double normal[3];
+ normal[0] = ( icos_r[icos_v[i][1]][1] - icos_r[icos_v[i][0]][1] ) * ( icos_r[icos_v[i][2]][2] - icos_r[icos_v[i][0]][2] ) - ( icos_r[icos_v[i][1]][2] - icos_r[icos_v[i][0]][2] ) * ( icos_r[icos_v[i][2]][1] - icos_r[icos_v[i][0]][1] );
+ normal[1] = ( icos_r[icos_v[i][1]][2] - icos_r[icos_v[i][0]][2] ) * ( icos_r[icos_v[i][2]][0] - icos_r[icos_v[i][0]][0] ) - ( icos_r[icos_v[i][1]][0] - icos_r[icos_v[i][0]][0] ) * ( icos_r[icos_v[i][2]][2] - icos_r[icos_v[i][0]][2] );
+ normal[2] = ( icos_r[icos_v[i][1]][0] - icos_r[icos_v[i][0]][0] ) * ( icos_r[icos_v[i][2]][1] - icos_r[icos_v[i][0]][1] ) - ( icos_r[icos_v[i][1]][1] - icos_r[icos_v[i][0]][1] ) * ( icos_r[icos_v[i][2]][0] - icos_r[icos_v[i][0]][0] );
+ glNormal3dv ( normal );
+ glVertex3dv ( icos_r[icos_v[i][0]] );
+ glVertex3dv ( icos_r[icos_v[i][1]] );
+ glVertex3dv ( icos_r[icos_v[i][2]] );
}
- glEnd () ;
+ glEnd ();
}
/*
{ 0.707106781187, 0.000000000000, 0.5 }, { 0.000000000000, 0.707106781187, 0.5 }, { -0.707106781187, 0.000000000000, 0.5 }, { 0.000000000000, -0.707106781187, 0.5 },
{ 0.707106781187, 0.707106781187, 0.0 }, { -0.707106781187, 0.707106781187, 0.0 }, { -0.707106781187, -0.707106781187, 0.0 }, { 0.707106781187, -0.707106781187, 0.0 },
{ 0.707106781187, 0.000000000000, -0.5 }, { 0.000000000000, 0.707106781187, -0.5 }, { -0.707106781187, 0.000000000000, -0.5 }, { 0.000000000000, -0.707106781187, -0.5 },
- { 0.0, 0.0, -1.0 } } ;
+ { 0.0, 0.0, -1.0 } };
int rdod_v [12][4] = { { 0, 1, 5, 2 }, { 0, 2, 6, 3 }, { 0, 3, 7, 4 }, { 0, 4, 8, 1 },
{ 5, 10, 6, 2 }, { 6, 11, 7, 3 }, { 7, 12, 8, 4 }, { 8, 9, 5, 1 },
- { 5, 9, 13, 10 }, { 6, 10, 13, 11 }, { 7, 11, 13, 12 }, { 8, 12, 13, 9 } } ;
+ { 5, 9, 13, 10 }, { 6, 10, 13, 11 }, { 7, 11, 13, 12 }, { 8, 12, 13, 9 } };
double rdod_n[12][3] = {
{ 0.353553390594, 0.353553390594, 0.5 }, { -0.353553390594, 0.353553390594, 0.5 }, { -0.353553390594, -0.353553390594, 0.5 }, { 0.353553390594, -0.353553390594, 0.5 },
{ 0.000000000000, 1.000000000000, 0.0 }, { -1.000000000000, 0.000000000000, 0.0 }, { 0.000000000000, -1.000000000000, 0.0 }, { 1.000000000000, 0.000000000000, 0.0 },
{ 0.353553390594, 0.353553390594, -0.5 }, { -0.353553390594, 0.353553390594, -0.5 }, { -0.353553390594, -0.353553390594, -0.5 }, { 0.353553390594, -0.353553390594, -0.5 }
- } ;
+ };
void FGAPIENTRY glutWireRhombicDodecahedron( void )
{
int i ;
for ( i = 0; i < 12; i++ )
{
- glBegin ( GL_LINE_LOOP ) ;
- glNormal3dv ( rdod_n[i] ) ;
- glVertex3dv ( rdod_r[rdod_v[i][0]] ) ;
- glVertex3dv ( rdod_r[rdod_v[i][1]] ) ;
- glVertex3dv ( rdod_r[rdod_v[i][2]] ) ;
- glVertex3dv ( rdod_r[rdod_v[i][3]] ) ;
- glEnd () ;
+ glBegin ( GL_LINE_LOOP );
+ glNormal3dv ( rdod_n[i] );
+ glVertex3dv ( rdod_r[rdod_v[i][0]] );
+ glVertex3dv ( rdod_r[rdod_v[i][1]] );
+ glVertex3dv ( rdod_r[rdod_v[i][2]] );
+ glVertex3dv ( rdod_r[rdod_v[i][3]] );
+ glEnd ();
}
}
{
int i ;
- glBegin ( GL_QUADS ) ;
+ glBegin ( GL_QUADS );
for ( i = 0; i < 12; i++ )
{
- glNormal3dv ( rdod_n[i] ) ;
- glVertex3dv ( rdod_r[rdod_v[i][0]] ) ;
- glVertex3dv ( rdod_r[rdod_v[i][1]] ) ;
- glVertex3dv ( rdod_r[rdod_v[i][2]] ) ;
- glVertex3dv ( rdod_r[rdod_v[i][3]] ) ;
+ glNormal3dv ( rdod_n[i] );
+ glVertex3dv ( rdod_r[rdod_v[i][0]] );
+ glVertex3dv ( rdod_r[rdod_v[i][1]] );
+ glVertex3dv ( rdod_r[rdod_v[i][2]] );
+ glVertex3dv ( rdod_r[rdod_v[i][3]] );
}
- glEnd () ;
+ glEnd ();
}
#define NUM_FACES 4
{ 0.5, -0.288675134595, -0.144337567297 },
{ 0.0, 0.577350269189, -0.144337567297 },
{ 0.0, 0.0, 0.672159013631 }
-} ;
+};
static GLint tetrahedron_i[4][3] = /* Vertex indices */
{
{ 0, 1, 2 }, { 0, 2, 3 }, { 0, 3, 1 }, { 1, 3, 2 }
-} ;
+};
static GLdouble tetrahedron_n[4][3] = /* Normals */
{
{ -0.816496580928, 0.471404520791, 0.333333333333 },
{ 0.0, -0.942809041582, 0.333333333333 },
{ 0.816496580928, 0.471404520791, 0.333333333333 }
-} ;
+};
void FGAPIENTRY glutWireSierpinskiSponge ( int num_levels, GLdouble offset[3], GLdouble scale )
{
for ( i = 0 ; i < NUM_FACES ; i++ )
{
- glBegin ( GL_LINE_LOOP ) ;
- glNormal3dv ( tetrahedron_n[i] ) ;
+ glBegin ( GL_LINE_LOOP );
+ glNormal3dv ( tetrahedron_n[i] );
for ( j = 0; j < 3; j++ )
{
- double x = offset[0] + scale * tetrahedron_v[tetrahedron_i[i][j]][0] ;
- double y = offset[1] + scale * tetrahedron_v[tetrahedron_i[i][j]][1] ;
- double z = offset[2] + scale * tetrahedron_v[tetrahedron_i[i][j]][2] ;
- glVertex3d ( x, y, z ) ;
+ double x = offset[0] + scale * tetrahedron_v[tetrahedron_i[i][j]][0];
+ double y = offset[1] + scale * tetrahedron_v[tetrahedron_i[i][j]][1];
+ double z = offset[2] + scale * tetrahedron_v[tetrahedron_i[i][j]][2];
+ glVertex3d ( x, y, z );
}
- glEnd () ;
+ glEnd ();
}
}
else
{
- GLdouble local_offset[3] ; /* Use a local variable to avoid buildup of roundoff errors */
- num_levels -- ;
+ GLdouble local_offset[3]; /* Use a local variable to avoid buildup of roundoff errors */
+ num_levels --;
scale /= 2.0 ;
- local_offset[0] = offset[0] + scale * tetrahedron_v[0][0] ;
- local_offset[1] = offset[1] + scale * tetrahedron_v[0][1] ;
- local_offset[2] = offset[2] + scale * tetrahedron_v[0][2] ;
- glutWireSierpinskiSponge ( num_levels, local_offset, scale ) ;
- local_offset[0] += scale ;
- glutWireSierpinskiSponge ( num_levels, local_offset, scale ) ;
- local_offset[0] -= 0.5 * scale ;
- local_offset[1] += 0.866025403784 * scale ;
- glutWireSierpinskiSponge ( num_levels, local_offset, scale ) ;
- local_offset[1] -= 0.577350269189 * scale ;
- local_offset[2] += 0.816496580928 * scale ;
- glutWireSierpinskiSponge ( num_levels, local_offset, scale ) ;
+ local_offset[0] = offset[0] + scale * tetrahedron_v[0][0];
+ local_offset[1] = offset[1] + scale * tetrahedron_v[0][1];
+ local_offset[2] = offset[2] + scale * tetrahedron_v[0][2];
+ glutWireSierpinskiSponge ( num_levels, local_offset, scale );
+ local_offset[0] += scale;
+ glutWireSierpinskiSponge ( num_levels, local_offset, scale );
+ local_offset[0] -= 0.5 * scale;
+ local_offset[1] += 0.866025403784 * scale;
+ glutWireSierpinskiSponge ( num_levels, local_offset, scale );
+ local_offset[1] -= 0.577350269189 * scale;
+ local_offset[2] += 0.816496580928 * scale;
+ glutWireSierpinskiSponge ( num_levels, local_offset, scale );
}
}
if ( num_levels == 0 )
{
- glBegin ( GL_TRIANGLES ) ;
+ glBegin ( GL_TRIANGLES );
for ( i = 0 ; i < NUM_FACES ; i++ )
{
- glNormal3dv ( tetrahedron_n[i] ) ;
+ glNormal3dv ( tetrahedron_n[i] );
for ( j = 0; j < 3; j++ )
{
- double x = offset[0] + scale * tetrahedron_v[tetrahedron_i[i][j]][0] ;
- double y = offset[1] + scale * tetrahedron_v[tetrahedron_i[i][j]][1] ;
- double z = offset[2] + scale * tetrahedron_v[tetrahedron_i[i][j]][2] ;
- glVertex3d ( x, y, z ) ;
+ double x = offset[0] + scale * tetrahedron_v[tetrahedron_i[i][j]][0];
+ double y = offset[1] + scale * tetrahedron_v[tetrahedron_i[i][j]][1];
+ double z = offset[2] + scale * tetrahedron_v[tetrahedron_i[i][j]][2];
+ glVertex3d ( x, y, z );
}
}
- glEnd () ;
+ glEnd ();
}
else
{
- GLdouble local_offset[3] ; /* Use a local variable to avoid buildup of roundoff errors */
- num_levels -- ;
+ GLdouble local_offset[3]; /* Use a local variable to avoid buildup of roundoff errors */
+ num_levels --;
scale /= 2.0 ;
- local_offset[0] = offset[0] + scale * tetrahedron_v[0][0] ;
- local_offset[1] = offset[1] + scale * tetrahedron_v[0][1] ;
- local_offset[2] = offset[2] + scale * tetrahedron_v[0][2] ;
- glutSolidSierpinskiSponge ( num_levels, local_offset, scale ) ;
- local_offset[0] += scale ;
- glutSolidSierpinskiSponge ( num_levels, local_offset, scale ) ;
- local_offset[0] -= 0.5 * scale ;
- local_offset[1] += 0.866025403784 * scale ;
- glutSolidSierpinskiSponge ( num_levels, local_offset, scale ) ;
- local_offset[1] -= 0.577350269189 * scale ;
- local_offset[2] += 0.816496580928 * scale ;
- glutSolidSierpinskiSponge ( num_levels, local_offset, scale ) ;
+ local_offset[0] = offset[0] + scale * tetrahedron_v[0][0];
+ local_offset[1] = offset[1] + scale * tetrahedron_v[0][1];
+ local_offset[2] = offset[2] + scale * tetrahedron_v[0][2];
+ glutSolidSierpinskiSponge ( num_levels, local_offset, scale );
+ local_offset[0] += scale;
+ glutSolidSierpinskiSponge ( num_levels, local_offset, scale );
+ local_offset[0] -= 0.5 * scale;
+ local_offset[1] += 0.866025403784 * scale;
+ glutSolidSierpinskiSponge ( num_levels, local_offset, scale );
+ local_offset[1] -= 0.577350269189 * scale;
+ local_offset[2] += 0.816496580928 * scale;
+ glutSolidSierpinskiSponge ( num_levels, local_offset, scale );
}
}
switch (eWhat)
{
case GLUT_INIT_STATE:
- return ( fgState.Initialised ) ;
+ return fgState.Initialised;
case GLUT_ELAPSED_TIME:
- return( fgElapsedTime() );
+ return fgElapsedTime();
}
freeglut_assert_ready;
/*
* Following values are stored in fgState and fgDisplay global structures
*/
- case GLUT_SCREEN_WIDTH: return( fgDisplay.ScreenWidth );
- case GLUT_SCREEN_HEIGHT: return( fgDisplay.ScreenHeight );
- case GLUT_SCREEN_WIDTH_MM: return( fgDisplay.ScreenWidthMM );
- case GLUT_SCREEN_HEIGHT_MM: return( fgDisplay.ScreenHeightMM );
- case GLUT_INIT_WINDOW_X: return( fgState.Position.X );
- case GLUT_INIT_WINDOW_Y: return( fgState.Position.Y );
- case GLUT_INIT_WINDOW_WIDTH: return( fgState.Size.X );
- case GLUT_INIT_WINDOW_HEIGHT: return( fgState.Size.Y );
- case GLUT_INIT_DISPLAY_MODE: return( fgState.DisplayMode );
+ case GLUT_SCREEN_WIDTH: return fgDisplay.ScreenWidth ;
+ case GLUT_SCREEN_HEIGHT: return fgDisplay.ScreenHeight ;
+ case GLUT_SCREEN_WIDTH_MM: return fgDisplay.ScreenWidthMM ;
+ case GLUT_SCREEN_HEIGHT_MM: return fgDisplay.ScreenHeightMM;
+ case GLUT_INIT_WINDOW_X: return fgState.Position.X ;
+ case GLUT_INIT_WINDOW_Y: return fgState.Position.Y ;
+ case GLUT_INIT_WINDOW_WIDTH: return fgState.Size.X ;
+ case GLUT_INIT_WINDOW_HEIGHT: return fgState.Size.Y ;
+ case GLUT_INIT_DISPLAY_MODE: return fgState.DisplayMode ;
/*
* The window/context specific queries are handled mostly by
/*
* XXX Multisampling. Return what I know about multisampling.
*/
- return( 0 );
+ return 0;
#if TARGET_HOST_UNIX_X11
/*
* The rest of GLX queries under X are general enough to use a macro to
* check them
*/
-# define GLX_QUERY(a,b) case a: return( fghGetConfig( b ) );
+# define GLX_QUERY(a,b) case a: return fghGetConfig( b );
GLX_QUERY( GLUT_WINDOW_RGBA, GLX_RGBA );
GLX_QUERY( GLUT_WINDOW_DOUBLEBUFFER, GLX_DOUBLEBUFFER );
* We've got a RGBA visual, so there is no colormap at all.
* The other possibility is that we have no current window set.
*/
- return( 0 );
+ return 0;
}
- return( fgStructure.Window->Window.VisualInfo->visual->map_entries );
+ return fgStructure.Window->Window.VisualInfo->visual->map_entries;
/*
* Those calls are somewhat similiar, as they use XGetWindowAttributes()
Window w;
if( fgStructure.Window == NULL )
- return( 0 );
+ return 0;
XTranslateCoordinates(
fgDisplay.Display,
}
if ( w == 0 )
- return( 0 );
+ return 0;
XTranslateCoordinates(
fgDisplay.Display,
fgStructure.Window->Window.Handle,
XWindowAttributes winAttributes;
if( fgStructure.Window == NULL )
- return( 0 );
+ return 0;
XGetWindowAttributes(
fgDisplay.Display,
fgStructure.Window->Window.Handle,
*/
case GLUT_WINDOW_FORMAT_ID:
if( fgStructure.Window == NULL )
- return( 0 );
+ return 0;
- return( fgStructure.Window->Window.VisualInfo->visualid );
+ return fgStructure.Window->Window.VisualInfo->visualid;
#elif TARGET_HOST_WIN32
* Handle the OpenGL inquiries
*/
case GLUT_WINDOW_RGBA:
- glGetBooleanv ( GL_RGBA_MODE, &boolValue ) ;
- returnValue = boolValue ? 1 : 0 ;
- return ( returnValue ) ;
+ glGetBooleanv ( GL_RGBA_MODE, &boolValue );
+ returnValue = boolValue ? 1 : 0;
+ return returnValue;
case GLUT_WINDOW_DOUBLEBUFFER:
- glGetBooleanv ( GL_DOUBLEBUFFER, &boolValue ) ;
- returnValue = boolValue ? 1 : 0 ;
- return ( returnValue ) ;
+ glGetBooleanv ( GL_DOUBLEBUFFER, &boolValue );
+ returnValue = boolValue ? 1 : 0;
+ return returnValue;
case GLUT_WINDOW_STEREO:
- glGetBooleanv ( GL_STEREO, &boolValue ) ;
- returnValue = boolValue ? 1 : 0 ;
- return ( returnValue ) ;
+ glGetBooleanv ( GL_STEREO, &boolValue );
+ returnValue = boolValue ? 1 : 0;
+ return returnValue;
case GLUT_WINDOW_RED_SIZE:
- glGetIntegerv ( GL_RED_BITS, &returnValue ) ;
- return ( returnValue ) ;
+ glGetIntegerv ( GL_RED_BITS, &returnValue );
+ return returnValue;
case GLUT_WINDOW_GREEN_SIZE:
- glGetIntegerv ( GL_GREEN_BITS, &returnValue ) ;
- return ( returnValue ) ;
+ glGetIntegerv ( GL_GREEN_BITS, &returnValue );
+ return returnValue;
case GLUT_WINDOW_BLUE_SIZE:
- glGetIntegerv ( GL_BLUE_BITS, &returnValue ) ;
- return ( returnValue ) ;
+ glGetIntegerv ( GL_BLUE_BITS, &returnValue );
+ return returnValue;
case GLUT_WINDOW_ALPHA_SIZE:
- glGetIntegerv ( GL_ALPHA_BITS, &returnValue ) ;
- return ( returnValue ) ;
+ glGetIntegerv ( GL_ALPHA_BITS, &returnValue );
+ return returnValue;
case GLUT_WINDOW_ACCUM_RED_SIZE:
- glGetIntegerv ( GL_ACCUM_RED_BITS, &returnValue ) ;
- return ( returnValue ) ;
+ glGetIntegerv ( GL_ACCUM_RED_BITS, &returnValue );
+ return returnValue;
case GLUT_WINDOW_ACCUM_GREEN_SIZE:
- glGetIntegerv ( GL_ACCUM_GREEN_BITS, &returnValue ) ;
- return ( returnValue ) ;
+ glGetIntegerv ( GL_ACCUM_GREEN_BITS, &returnValue );
+ return returnValue;
case GLUT_WINDOW_ACCUM_BLUE_SIZE:
- glGetIntegerv ( GL_ACCUM_BLUE_BITS, &returnValue ) ;
- return ( returnValue ) ;
+ glGetIntegerv ( GL_ACCUM_BLUE_BITS, &returnValue );
+ return returnValue;
case GLUT_WINDOW_ACCUM_ALPHA_SIZE:
- glGetIntegerv ( GL_ACCUM_ALPHA_BITS, &returnValue ) ;
- return ( returnValue ) ;
+ glGetIntegerv ( GL_ACCUM_ALPHA_BITS, &returnValue );
+ return returnValue;
case GLUT_WINDOW_DEPTH_SIZE:
- glGetIntegerv ( GL_DEPTH_BITS, &returnValue ) ;
- return ( returnValue ) ;
+ glGetIntegerv ( GL_DEPTH_BITS, &returnValue );
+ return returnValue;
case GLUT_WINDOW_BUFFER_SIZE:
returnValue = 1 ; /* ????? */
- return ( returnValue ) ;
+ return returnValue;
case GLUT_WINDOW_STENCIL_SIZE:
returnValue = 0 ; /* ????? */
- return ( returnValue ) ;
+ return returnValue;
case GLUT_WINDOW_X:
case GLUT_WINDOW_Y:
switch( eWhat )
{
- case GLUT_WINDOW_X: return( winRect.left );
- case GLUT_WINDOW_Y: return( winRect.top );
- case GLUT_WINDOW_WIDTH: return( winRect.right - winRect.left );
- case GLUT_WINDOW_HEIGHT: return( winRect.bottom - winRect.top );
+ case GLUT_WINDOW_X: return winRect.left ;
+ case GLUT_WINDOW_Y: return winRect.top ;
+ case GLUT_WINDOW_WIDTH: return winRect.right - winRect.left;
+ case GLUT_WINDOW_HEIGHT: return winRect.bottom - winRect.top;
}
}
break;
case GLUT_WINDOW_BORDER_WIDTH :
- return ( GetSystemMetrics( SM_CXSIZEFRAME ) ) ;
+ return GetSystemMetrics( SM_CXSIZEFRAME );
case GLUT_WINDOW_HEADER_HEIGHT :
- return ( GetSystemMetrics( SM_CYCAPTION ) ) ;
+ return GetSystemMetrics( SM_CYCAPTION );
case GLUT_DISPLAY_MODE_POSSIBLE:
- return( fgSetupPixelFormat( fgStructure.Window, GL_TRUE,
- PFD_MAIN_PLANE ) );
+ return fgSetupPixelFormat( fgStructure.Window, GL_TRUE,
+ PFD_MAIN_PLANE );
case GLUT_WINDOW_FORMAT_ID:
if( fgStructure.Window != NULL )
- return( GetPixelFormat( fgStructure.Window->Window.Device ) );
- return( 0 );
+ return GetPixelFormat( fgStructure.Window->Window.Device );
+ return 0;
#endif
* The window structure queries
*/
case GLUT_WINDOW_PARENT:
- if( fgStructure.Window == NULL ) return( 0 );
- if( fgStructure.Window->Parent == NULL ) return( 0 );
- return( fgStructure.Window->Parent->ID );
+ if( fgStructure.Window == NULL ) return 0;
+ if( fgStructure.Window->Parent == NULL ) return 0;
+ return fgStructure.Window->Parent->ID;
case GLUT_WINDOW_NUM_CHILDREN:
if( fgStructure.Window == NULL )
- return( 0 );
- return( fgListLength( &fgStructure.Window->Children ) );
+ return 0;
+ return fgListLength( &fgStructure.Window->Children );
case GLUT_WINDOW_CURSOR:
if( fgStructure.Window == NULL )
- return( 0 );
- return( fgStructure.Window->State.Cursor );
+ return 0;
+ return fgStructure.Window->State.Cursor;
case GLUT_MENU_NUM_ITEMS:
if( fgStructure.Menu == NULL )
- return( 0 );
- return( fgListLength( &fgStructure.Menu->Entries ) );
+ return 0;
+ return fgListLength( &fgStructure.Menu->Entries );
case GLUT_ACTION_ON_WINDOW_CLOSE:
- return fgState.ActionOnWindowClose ;
+ return fgState.ActionOnWindowClose;
case GLUT_VERSION :
- return VERSION_MAJOR * 10000 + VERSION_MINOR * 100 + VERSION_PATCH ;
+ return VERSION_MAJOR * 10000 + VERSION_MINOR * 100 + VERSION_PATCH;
case GLUT_RENDERING_CONTEXT:
- return ( fgState.UseCurrentContext ? GLUT_USE_CURRENT_CONTEXT : GLUT_CREATE_NEW_CONTEXT ) ;
+ return fgState.UseCurrentContext ? GLUT_USE_CURRENT_CONTEXT
+ : GLUT_CREATE_NEW_CONTEXT;
default:
fgWarning( "glutGet(): missing enum handle %i\n", eWhat );
break;
}
- return( -1 );
+ return -1;
}
/*
* XXX Though in actuality, we can probably assume BOTH a
* XXX mouse and keyboard for most/all of our users.
*/
- return( TRUE );
+ return TRUE ;
#if TARGET_HOST_UNIX_X11
case GLUT_HAS_MOUSE:
- return( TRUE );
+ return TRUE ;
case GLUT_NUM_MOUSE_BUTTONS:
/*
* XXX XFree86...) It is at least worth taking a look at
* XXX this file.
*/
- return( 3 );
+ return 3 ;
#elif TARGET_HOST_WIN32
* The Windows can be booted without a mouse.
* It would be nice to have this reported.
*/
- return( GetSystemMetrics( SM_MOUSEPRESENT ) );
+ return GetSystemMetrics( SM_MOUSEPRESENT );
case GLUT_NUM_MOUSE_BUTTONS:
/*
* We are much more fortunate under Win32 about this...
*/
- return( GetSystemMetrics( SM_CMOUSEBUTTONS ) );
+ return GetSystemMetrics( SM_CMOUSEBUTTONS );
#endif
/*
* XXX WARNING: THIS IS A BIG LIE!
*/
- return( 0 );
+ return 0;
case GLUT_HAS_SPACEBALL:
case GLUT_HAS_DIAL_AND_BUTTON_BOX:
case GLUT_HAS_TABLET:
- return( FALSE );
+ return FALSE;
case GLUT_NUM_SPACEBALL_BUTTONS:
case GLUT_NUM_BUTTON_BOX_BUTTONS:
case GLUT_NUM_DIALS:
case GLUT_NUM_TABLET_BUTTONS:
- return( 0 );
+ return 0;
case GLUT_DEVICE_IGNORE_KEY_REPEAT:
- return( fgState.IgnoreKeyRepeat );
+ return fgState.IgnoreKeyRepeat;
case GLUT_DEVICE_KEY_REPEAT:
/*
* XXX WARNING: THIS IS A BIG LIE!
*/
- return( GLUT_KEY_REPEAT_DEFAULT );
+ return GLUT_KEY_REPEAT_DEFAULT;
default:
fgWarning( "glutDeviceGet(): missing enum handle %i\n", eWhat );
/*
* And now -- the failure.
*/
- return( -1 );
+ return -1;
}
/*
if( fgState.Modifiers == 0xffffffff )
{
fgWarning( "glutGetModifiers() called outside an input callback" );
- return( 0 );
+ return 0;
}
- return( fgState.Modifiers );
+ return fgState.Modifiers;
}
/*
#if TARGET_HOST_UNIX_X11
case GLUT_OVERLAY_POSSIBLE:
- return( FALSE );
+ return FALSE;
case GLUT_LAYER_IN_USE:
- return( GLUT_NORMAL );
+ return GLUT_NORMAL;
case GLUT_HAS_OVERLAY:
- return( FALSE );
+ return FALSE;
case GLUT_TRANSPARENT_INDEX:
/*
*
* XXX HUH?
*/
- return( 0 );
+ return 0;
case GLUT_NORMAL_DAMAGED:
/*
* XXX Actually I do not know. Maybe.
*/
- return( FALSE );
+ return FALSE;
case GLUT_OVERLAY_DAMAGED:
- return( -1 );
+ return -1;
#elif TARGET_HOST_WIN32
case GLUT_OVERLAY_POSSIBLE:
-/* return( fgSetupPixelFormat( fgStructure.Window, GL_TRUE,
- PFD_OVERLAY_PLANE ) ); */
+/* return fgSetupPixelFormat( fgStructure.Window, GL_TRUE,
+ PFD_OVERLAY_PLANE ); */
return FALSE ;
case GLUT_LAYER_IN_USE:
- return( GLUT_NORMAL );
+ return GLUT_NORMAL;
case GLUT_HAS_OVERLAY:
- return( FALSE );
+ return FALSE;
case GLUT_TRANSPARENT_INDEX:
/*
*
* XXX HUH?
*/
- return( 0 );
+ return 0;
case GLUT_NORMAL_DAMAGED:
/*
* XXX Actually I do not know. Maybe.
*/
- return( FALSE );
+ return FALSE;
case GLUT_OVERLAY_DAMAGED:
- return( -1 );
+ return -1;
#endif
default:
/*
* And fail. That's good. Programs do love failing.
*/
- return( -1 );
+ return -1;
}
/*** END OF FILE ***/