Main Page | Namespace List | Class Hierarchy | Compound List | File List | Compound Members | File Members | Related Pages

glut_shapes.c File Reference

#include <math.h>
#include <stdio.h>
#include "glut.h"

Defines

#define M_PI   3.14159265358979323846
#define QUAD_OBJ_INIT()   { if(!quadObj) initQuadObj(); }
#define DIFF3(_a, _b, _c)
#define X   .525731112119133606
#define Z   .850650808352039932
#define T   1.73205080756887729

Functions

void initQuadObj (void)
void GLUTAPIENTRY glutWireSphere (GLdouble radius, GLint slices, GLint stacks)
void GLUTAPIENTRY glutSolidSphere (GLdouble radius, GLint slices, GLint stacks)
void GLUTAPIENTRY glutWireCone (GLdouble base, GLdouble height, GLint slices, GLint stacks)
void GLUTAPIENTRY glutSolidCone (GLdouble base, GLdouble height, GLint slices, GLint stacks)
void drawBox (GLfloat size, GLenum type)
void GLUTAPIENTRY glutWireCube (GLdouble size)
void GLUTAPIENTRY glutSolidCube (GLdouble size)
void doughnut (GLfloat r, GLfloat R, GLint nsides, GLint rings)
void GLUTAPIENTRY glutWireTorus (GLdouble innerRadius, GLdouble outerRadius, GLint nsides, GLint rings)
void GLUTAPIENTRY glutSolidTorus (GLdouble innerRadius, GLdouble outerRadius, GLint nsides, GLint rings)
void initDodecahedron (void)
void crossprod (GLfloat v1[3], GLfloat v2[3], GLfloat prod[3])
void normalize (GLfloat v[3])
void pentagon (int a, int b, int c, int d, int e, GLenum shadeType)
void dodecahedron (GLenum type)
void GLUTAPIENTRY glutWireDodecahedron (void)
void GLUTAPIENTRY glutSolidDodecahedron (void)
void recorditem (GLfloat *n1, GLfloat *n2, GLfloat *n3, GLenum shadeType)
void subdivide (GLfloat *v0, GLfloat *v1, GLfloat *v2, GLenum shadeType)
void drawtriangle (int i, GLfloat data[][3], int ndx[][3], GLenum shadeType)
void octahedron (GLenum shadeType)
void GLUTAPIENTRY glutWireOctahedron (void)
void GLUTAPIENTRY glutSolidOctahedron (void)
void icosahedron (GLenum shadeType)
void GLUTAPIENTRY glutWireIcosahedron (void)
void GLUTAPIENTRY glutSolidIcosahedron (void)
void tetrahedron (GLenum shadeType)
void GLUTAPIENTRY glutWireTetrahedron (void)
void GLUTAPIENTRY glutSolidTetrahedron (void)

Variables

GLUquadricObj * quadObj
GLfloat dodec [20][3]
GLfloat odata [6][3]
int ondex [8][3]
GLfloat idata [12][3]
int index [20][3]
GLfloat tdata [4][3]
int tndex [4][3]

Define Documentation

#define DIFF3 _a,
_b,
_c   ) 
 

Value:

{ \
    (_c)[0] = (_a)[0] - (_b)[0]; \
    (_c)[1] = (_a)[1] - (_b)[1]; \
    (_c)[2] = (_a)[2] - (_b)[2]; \
}

#define M_PI   3.14159265358979323846
 

(c) Copyright 1993, Silicon Graphics, Inc.

ALL RIGHTS RESERVED

Permission to use, copy, modify, and distribute this software for any purpose and without fee is hereby granted, provided that the above copyright notice appear in all copies and that both the copyright notice and this permission notice appear in supporting documentation, and that the name of Silicon Graphics, Inc. not be used in advertising or publicity pertaining to distribution of the software without specific, written prior permission.

THE MATERIAL EMBODIED ON THIS SOFTWARE IS PROVIDED TO YOU "AS-IS" AND WITHOUT WARRANTY OF ANY KIND, EXPRESS, IMPLIED OR OTHERWISE, INCLUDING WITHOUT LIMITATION, ANY WARRANTY OF MERCHANTABILITY OR FITNESS FOR A PARTICULAR PURPOSE. IN NO EVENT SHALL SILICON GRAPHICS, INC. BE LIABLE TO YOU OR ANYONE ELSE FOR ANY DIRECT, SPECIAL, INCIDENTAL, INDIRECT OR CONSEQUENTIAL DAMAGES OF ANY KIND, OR ANY DAMAGES WHATSOEVER, INCLUDING WITHOUT LIMITATION, LOSS OF PROFIT, LOSS OF USE, SAVINGS OR REVENUE, OR THE CLAIMS OF THIRD PARTIES, WHETHER OR NOT SILICON GRAPHICS, INC. HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH LOSS, HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, ARISING OUT OF OR IN CONNECTION WITH THE POSSESSION, USE OR PERFORMANCE OF THIS SOFTWARE.

US Government Users Restricted Rights

Use, duplication, or disclosure by the Government is subject to restrictions set forth in FAR 52.227.19(c)(2) or subparagraph (c)(1)(ii) of the Rights in Technical Data and Computer Software clause at DFARS 252.227-7013 and/or in similar or successor clauses in the FAR or the DOD or NASA FAR Supplement. Unpublished-- rights reserved under the copyright laws of the United States. Contractor/manufacturer is Silicon Graphics, Inc., 2011 N. Shoreline Blvd., Mountain View, CA 94039-7311.

OpenGL(TM) is a trademark of Silicon Graphics, Inc.

 
#define QUAD_OBJ_INIT  )     { if(!quadObj) initQuadObj(); }
 

#define T   1.73205080756887729
 

#define X   .525731112119133606
 

#define Z   .850650808352039932
 


Function Documentation

void crossprod GLfloat  v1[3],
GLfloat  v2[3],
GLfloat  prod[3]
[static]
 

void dodecahedron GLenum  type  )  [static]
 

void doughnut GLfloat  r,
GLfloat  R,
GLint  nsides,
GLint  rings
[static]
 

void drawBox GLfloat  size,
GLenum  type
[static]
 

void drawtriangle int  i,
GLfloat  data[][3],
int  ndx[][3],
GLenum  shadeType
[static]
 

void GLUTAPIENTRY glutSolidCone GLdouble  base,
GLdouble  height,
GLint  slices,
GLint  stacks
 

void GLUTAPIENTRY glutSolidCube GLdouble  size  ) 
 

void GLUTAPIENTRY glutSolidDodecahedron void   ) 
 

void GLUTAPIENTRY glutSolidIcosahedron void   ) 
 

void GLUTAPIENTRY glutSolidOctahedron void   ) 
 

void GLUTAPIENTRY glutSolidSphere GLdouble  radius,
GLint  slices,
GLint  stacks
 

void GLUTAPIENTRY glutSolidTetrahedron void   ) 
 

void GLUTAPIENTRY glutSolidTorus GLdouble  innerRadius,
GLdouble  outerRadius,
GLint  nsides,
GLint  rings
 

void GLUTAPIENTRY glutWireCone GLdouble  base,
GLdouble  height,
GLint  slices,
GLint  stacks
 

void GLUTAPIENTRY glutWireCube GLdouble  size  ) 
 

void GLUTAPIENTRY glutWireDodecahedron void   ) 
 

void GLUTAPIENTRY glutWireIcosahedron void   ) 
 

void GLUTAPIENTRY glutWireOctahedron void   ) 
 

void GLUTAPIENTRY glutWireSphere GLdouble  radius,
GLint  slices,
GLint  stacks
 

void GLUTAPIENTRY glutWireTetrahedron void   ) 
 

void GLUTAPIENTRY glutWireTorus GLdouble  innerRadius,
GLdouble  outerRadius,
GLint  nsides,
GLint  rings
 

void icosahedron GLenum  shadeType  )  [static]
 

void initDodecahedron void   )  [static]
 

void initQuadObj void   )  [static]
 

void normalize GLfloat  v[3]  )  [static]
 

void octahedron GLenum  shadeType  )  [static]
 

void pentagon int  a,
int  b,
int  c,
int  d,
int  e,
GLenum  shadeType
[static]
 

void recorditem GLfloat *  n1,
GLfloat *  n2,
GLfloat *  n3,
GLenum  shadeType
[static]
 

void subdivide GLfloat *  v0,
GLfloat *  v1,
GLfloat *  v2,
GLenum  shadeType
[static]
 

void tetrahedron GLenum  shadeType  )  [static]
 


Variable Documentation

GLfloat dodec[20][3] [static]
 

GLfloat idata[12][3] [static]
 

Initial value:

{
  {-X, 0, Z},
  {X, 0, Z},
  {-X, 0, -Z},
  {X, 0, -Z},
  {0, Z, X},
  {0, Z, -X},
  {0, -Z, X},
  {0, -Z, -X},
  {Z, X, 0},
  {-Z, X, 0},
  {Z, -X, 0},
  {-Z, -X, 0}
}

int index[20][3] [static]
 

Initial value:

{
  {0, 4, 1},
  {0, 9, 4},
  {9, 5, 4},
  {4, 5, 8},
  {4, 8, 1},
  {8, 10, 1},
  {8, 3, 10},
  {5, 3, 8},
  {5, 2, 3},
  {2, 7, 3},
  {7, 10, 3},
  {7, 6, 10},
  {7, 11, 6},
  {11, 0, 6},
  {0, 1, 6},
  {6, 1, 10},
  {9, 0, 11},
  {9, 11, 2},
  {9, 2, 5},
  {7, 2, 11},
}

GLfloat odata[6][3] [static]
 

Initial value:

{
  {1.0, 0.0, 0.0},
  {-1.0, 0.0, 0.0},
  {0.0, 1.0, 0.0},
  {0.0, -1.0, 0.0},
  {0.0, 0.0, 1.0},
  {0.0, 0.0, -1.0}
}

int ondex[8][3] [static]
 

Initial value:

{
  {0, 4, 2},
  {1, 2, 4},
  {0, 3, 4},
  {1, 4, 3},
  {0, 2, 5},
  {1, 5, 2},
  {0, 5, 3},
  {1, 3, 5}
}

GLUquadricObj* quadObj [static]
 

GLfloat tdata[4][3] [static]
 

Initial value:

{
  {T, T, T},
  {T, -T, -T},
  {-T, T, -T},
  {-T, -T, T}
}

int tndex[4][3] [static]
 

Initial value:

{
  {0, 1, 3},
  {2, 1, 0},
  {3, 2, 0},
  {1, 2, 3}
}


Generated on Fri Feb 27 12:01:40 2004 for Glitch by doxygen 1.3.2