com.hermetica.util3d
Class shapes

java.lang.Object
  |
  +--com.hermetica.util3d.shapes

public class shapes
extends java.lang.Object

Utility class providing methods to create simple geometric primitives quickly, such as various Platonic solids and the teapotahedron, the lesser known cousin ( more a Socratic solid ).

The original routines to create these primitives is taken from the GLUT toolkit. Additionally, the GLU library is used from some quadric primitives.

Version:
$Id: shapes.java,v 1.12 1998/08/17 17:34:13 descarte Exp descarte $
Author:
Alligator Descartes
See Also:
GLU.gluSphere(com.hermetica.magician.GLUQuadric, double, int, int), GLU.gluCylinder(com.hermetica.magician.GLUQuadric, double, double, double, int, int)

Field Summary
static java.lang.String VERSION
          Version information
 
Constructor Summary
shapes()
           
 
Method Summary
static void solidCone(double base, double height, int slices, int stacks)
          Creates a solid cone
static void solidCube(double size)
          Draw a solid box
static void solidDodecahedron()
          Draws a solid dodecahedron
static void solidIcosahedron()
          Draws a solid icosahedron
static void solidOctahedron()
          Draws a solid octahedron
static void solidShell()
          Draws a solid spiral shell
static void solidShell(int divisions, int strips)
          Draws a solid spiral shell with the given number of divisions and strips
static void solidSphere(double radius, int slices, int stacks)
          Creates a solid sphere
static void solidTeapot(double scale)
          Draws a solid teapot
static void solidTetrahedron()
          Draws a solid tetrahedron
static void solidTorus(double innerRadius, double outerRadius, int nsides, int rings)
          Draws a solid torus
static void teapot(int grid, double scale, int type)
          Builds a generic teapot
static void wireCone(double base, double height, int slices, int stacks)
          Creates a wireframe cone
static void wireCube(double size)
          Draw a wireframe cube
static void wireDodecahedron()
          Draws a wire dodecahedron
static void wireIcosahedron()
          Draws a wireframe icosahedron
static void wireOctahedron()
          Draws a wireframe octahedron
static void wireShell()
          Draws a wireframe spiral shell
static void wireShell(int divisions, int strips)
          Draws a wireframe spiral shell with the given number of divisions and strips
static void wireSphere(double radius, int slices, int stacks)
          Creates a wire sphere
static void wireTeapot(double scale)
          Draws a wireframe teapot
static void wireTetrahedron()
          Draws a wireframe tetrahedron
static void wireTorus(double innerRadius, double outerRadius, int nsides, int rings)
          Draws a wire torus
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

VERSION

public static final java.lang.String VERSION
Version information
Constructor Detail

shapes

public shapes()
Method Detail

wireSphere

public static void wireSphere(double radius,
                              int slices,
                              int stacks)
                       throws OpenGLException
Creates a wire sphere

solidSphere

public static void solidSphere(double radius,
                               int slices,
                               int stacks)
                        throws OpenGLException
Creates a solid sphere

wireCone

public static void wireCone(double base,
                            double height,
                            int slices,
                            int stacks)
                     throws OpenGLException
Creates a wireframe cone

solidCone

public static void solidCone(double base,
                             double height,
                             int slices,
                             int stacks)
                      throws OpenGLException
Creates a solid cone

wireCube

public static void wireCube(double size)
                     throws OpenGLException
Draw a wireframe cube

solidCube

public static void solidCube(double size)
                      throws OpenGLException
Draw a solid box

wireTorus

public static void wireTorus(double innerRadius,
                             double outerRadius,
                             int nsides,
                             int rings)
                      throws OpenGLException
Draws a wire torus

solidTorus

public static void solidTorus(double innerRadius,
                              double outerRadius,
                              int nsides,
                              int rings)
                       throws OpenGLException
Draws a solid torus

wireDodecahedron

public static void wireDodecahedron()
                             throws OpenGLException
Draws a wire dodecahedron

solidDodecahedron

public static void solidDodecahedron()
                              throws OpenGLException
Draws a solid dodecahedron

teapot

public static void teapot(int grid,
                          double scale,
                          int type)
                   throws OpenGLException
Builds a generic teapot

solidTeapot

public static void solidTeapot(double scale)
                        throws OpenGLException
Draws a solid teapot

wireTeapot

public static void wireTeapot(double scale)
                       throws OpenGLException
Draws a wireframe teapot

wireOctahedron

public static void wireOctahedron()
                           throws OpenGLException
Draws a wireframe octahedron

solidOctahedron

public static void solidOctahedron()
                            throws OpenGLException
Draws a solid octahedron

solidIcosahedron

public static void solidIcosahedron()
                             throws OpenGLException
Draws a solid icosahedron

wireIcosahedron

public static void wireIcosahedron()
                            throws OpenGLException
Draws a wireframe icosahedron

wireTetrahedron

public static void wireTetrahedron()
                            throws OpenGLException
Draws a wireframe tetrahedron

solidTetrahedron

public static void solidTetrahedron()
                             throws OpenGLException
Draws a solid tetrahedron

wireShell

public static void wireShell()
                      throws OpenGLException
Draws a wireframe spiral shell

wireShell

public static void wireShell(int divisions,
                             int strips)
                      throws OpenGLException
Draws a wireframe spiral shell with the given number of divisions and strips

solidShell

public static void solidShell()
                       throws OpenGLException
Draws a solid spiral shell

solidShell

public static void solidShell(int divisions,
                              int strips)
                       throws OpenGLException
Draws a solid spiral shell with the given number of divisions and strips