|
NASA World Wind | ||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
java.lang.Objectgov.nasa.worldwind.util.GLUTessellatorSupport
public class GLUTessellatorSupport
GLUTessellatorSupport is a utility class for configuring and using a GLUtessellator to
tessellate complex polygons into triangles.
GLUTessellatorSupport glts = new GLUTessellatorSupport();
GLUtessellatorCallback cb = ...; // Reference to an
implementation of GLUtessellatorCallback.
Vec4 normal = new Vec4(0, 0, 1); // The polygon's normal. This example
shows an appropriate normal for tessellating x-y coordinates.
glts.beginTessellation(cb, new Vec4(0,
0, 1));
try
{
GLUtessellator tess = glts.getGLUtessellator();
}
finally
{
glts.endTessellation();
}
| Nested Class Summary | |
|---|---|
static class |
GLUTessellatorSupport.CollectIndexListsCallback
Provides the callback class used to capture the shapes determined by the tessellator. |
protected static class |
GLUTessellatorSupport.OGLDrawPrimitivesCallback
|
| Field Summary | |
|---|---|
protected GLUtessellator |
tess
|
| Constructor Summary | |
|---|---|
GLUTessellatorSupport()
Creates a new GLUTessellatorSupport, but otherwise does nothing. |
|
| Method Summary | |
|---|---|
void |
beginTessellation(GLUtessellatorCallback callback,
Vec4 normal)
Prepares this GLUTessellatorSupport's internal GLU tessellator for use. |
static GLUtessellatorCallback |
createOGLDrawPrimitivesCallback(GL2 gl)
Creates a new GLUtessellatorCallback that draws tessellated polygons as OpenGL
primitives by calling glBegin, glEnd, and glVertex. |
void |
endTessellation()
Frees any GLU resources used by this GLUTessellatorSupport, and invalidates this instance's internal GLU tessellator. |
GLUtessellator |
getGLUtessellator()
Returns this GLUTessellatorSupport's internal GLUtessellator instance. |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Field Detail |
|---|
protected GLUtessellator tess
| Constructor Detail |
|---|
public GLUTessellatorSupport()
| Method Detail |
|---|
public void beginTessellation(GLUtessellatorCallback callback,
Vec4 normal)
GLU.gluNewTess(), and configures the
tessellator with the specified callback and normal with calls to GLU.gluTessCallback(javax.media.opengl.glu.GLUtessellator,
int, javax.media.opengl.glu.GLUtessellatorCallback) and GLU.gluTessNormal(javax.media.opengl.glu.GLUtessellator,
double, double, double), respectively.
callback - the callback to configure the GLU tessellator with.normal - the normal to configure the GLU tessellator with.
IllegalArgumentException - if the callback or the normal is null.public static GLUtessellatorCallback createOGLDrawPrimitivesCallback(GL2 gl)
GLUtessellatorCallback that draws tessellated polygons as OpenGL
primitives by calling glBegin, glEnd, and glVertex.
gl - the GL context to draw into.
IllegalArgumentException - if the GL is null.public void endTessellation()
public GLUtessellator getGLUtessellator()
GLUtessellator instance. This
returns a valid GLUtessellator instance if called between beginTessellation(javax.media.opengl.glu.GLUtessellatorCallback,
gov.nasa.worldwind.geom.Vec4) and endTessellation(). This returns null if called from outside a
beginTessellation/endTessellation block.
|
NASA World Wind | ||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||