예제 #1
0
파일: mech.c 프로젝트: kendallb/scitech-mgl
static void makeSolidSphere(
    GLdouble radius,
    GLint slices,
    GLint stacks)
{
    QUAD_OBJ_INIT();
    gluQuadricDrawStyle(quadObj, GLU_FILL);
    gluQuadricNormals(quadObj, GLU_SMOOTH);
    gluSphere(quadObj, radius, slices, stacks);
}
예제 #2
0
void APIENTRY
glutSolidSphere(GLdouble radius, GLint slices, GLint stacks)
{
  QUAD_OBJ_INIT();
  gluQuadricDrawStyle(quadObj, GLU_FILL);
  gluQuadricNormals(quadObj, GLU_SMOOTH);
  /* If we ever changed/used the texture or orientation state
     of quadObj, we'd need to change it to the defaults here
     with gluQuadricTexture and/or gluQuadricOrientation. */
  gluSphere(quadObj, radius, slices, stacks);
}
예제 #3
0
void APIENTRY
glutWireCone(GLdouble base, GLdouble height,
  GLint slices, GLint stacks)
{
  QUAD_OBJ_INIT();
  gluQuadricDrawStyle(quadObj, GLU_LINE);
  gluQuadricNormals(quadObj, GLU_SMOOTH);
  /* If we ever changed/used the texture or orientation state
     of quadObj, we'd need to change it to the defaults here
     with gluQuadricTexture and/or gluQuadricOrientation. */
  gluCylinder(quadObj, base, 0.0, height, slices, stacks);
}
예제 #4
0
/**
 * draw_sphere:
 * @solid: TRUE if the sphere should be solid.
 * @radius: the radius of the sphere.
 * @slices: the number of subdivisions around the Z axis (similar to lines of
 *          longitude).
 * @stacks: the number of subdivisions along the Z axis (similar to lines of
 *          latitude).
 *
 * Renders a sphere centered at the modeling coordinates origin of
 * the specified @radius. The sphere is subdivided around the Z axis into
 * @slices and along the Z axis into @stacks. 
 *
 **/
void
draw_sphere (gboolean solid,
             double   radius,
             int      slices,
             int      stacks)
{
  QUAD_OBJ_INIT();

  if (solid)
    gluQuadricDrawStyle (quadObj, GLU_FILL);
  else
    gluQuadricDrawStyle (quadObj, GLU_LINE);

  gluQuadricNormals (quadObj, GLU_SMOOTH);

  /* If we ever changed/used the texture or orientation state
     of quadObj, we'd need to change it to the defaults here
     with gluQuadricTexture and/or gluQuadricOrientation. */
  gluSphere (quadObj, radius, slices, stacks);
}