Top Constructors Methods
org.lwjgl.test.glu.tessellation

public Class TessCallback

extends GLUtessellatorCallbackAdapter
Class Inheritance
Imports
org.lwjgl.util.glu.GLUtessellatorCallbackAdapter

Constructor Summary

AccessConstructor and Description
public

Method Summary

Modifier and TypeMethod and Description
public void
begin(int
Specifics the type of begin/end pair being defined. The following values are valid: GL_TRIANGLE_FAN, GL_TRIANGLE_STRIP, GL_TRIANGLES or GL_LINE_LOOP.
type
)

Overrides org.lwjgl.util.glu.GLUtessellatorCallbackAdapter.begin.

Implements org.lwjgl.util.glu.GLUtessellatorCallback.begin.

The begin callback method is invoked like glBegin to indicate the start of a (triangle) primitive.
public void
combine(double[]
Specifics the location of the new vertex.
coords
,
Object[]
Specifics the vertices used to create the new vertex.
data
,
float[]
Specifics the weights used to create the new vertex.
weight
,
Object[]
Reference user the put the coodinates of the new vertex.
outData
)

Overrides org.lwjgl.util.glu.GLUtessellatorCallbackAdapter.combine.

Implements org.lwjgl.util.glu.GLUtessellatorCallback.combine.

The combine callback method is called to create a new vertex when the tessellation detects an intersection, or wishes to merge features.
public void
end()

Overrides org.lwjgl.util.glu.GLUtessellatorCallbackAdapter.end.

Implements org.lwjgl.util.glu.GLUtessellatorCallback.end.

The end callback serves the same purpose as glEnd.
public void
vertex(Object
Specifics a reference to the vertices of the triangles created byt the tessellatin process.
vertexData
)

Overrides org.lwjgl.util.glu.GLUtessellatorCallbackAdapter.vertex.

Implements org.lwjgl.util.glu.GLUtessellatorCallback.vertex.

The vertex callback method is invoked between the begin and end callback methods.
Inherited from org.lwjgl.util.glu.GLUtessellatorCallbackAdapter:
beginDatacombineDataedgeFlagedgeFlagDataendDataerrorerrorDatavertexData

Constructor Detail

TessCallbackback to summary
public TessCallback()

Method Detail

beginback to summary
public void begin(int type)

Overrides org.lwjgl.util.glu.GLUtessellatorCallbackAdapter.begin.

Implements org.lwjgl.util.glu.GLUtessellatorCallback.begin.

Doc from org.lwjgl.util.glu.GLUtessellatorCallback.begin.

The begin callback method is invoked like glBegin to indicate the start of a (triangle) primitive. The method takes a single argument of type int. If the GLU_TESS_BOUNDARY_ONLY property is set to GL_FALSE, then the argument is set to either GL_TRIANGLE_FAN, GL_TRIANGLE_STRIP, or GL_TRIANGLES. If the GLU_TESS_BOUNDARY_ONLY property is set to GL_TRUE, then the argument will be set to GL_LINE_LOOP.

Parameters
type:int

Specifics the type of begin/end pair being defined. The following values are valid: GL_TRIANGLE_FAN, GL_TRIANGLE_STRIP, GL_TRIANGLES or GL_LINE_LOOP.

combineback to summary
public void combine(double[] coords, Object[] data, float[] weight, Object[] outData)

Overrides org.lwjgl.util.glu.GLUtessellatorCallbackAdapter.combine.

Implements org.lwjgl.util.glu.GLUtessellatorCallback.combine.

Doc from org.lwjgl.util.glu.GLUtessellatorCallback.combine.

The combine callback method is called to create a new vertex when the tessellation detects an intersection, or wishes to merge features. The method takes four arguments: an array of three elements each of type double, an array of four references, an array of four elements each of type float, and a reference to a reference.

The vertex is defined as a linear combination of up to four existing vertices, stored in data. The coefficients of the linear combination are given by weight; these weights always add up to 1. All vertex pointers are valid even when some of the weights are 0. coords gives the location of the new vertex.

The user must allocate another vertex, interpolate parameters using data and weight, and return the new vertex pointer in outData. This handle is supplied during rendering callbacks. The user is responsible for freeing the memory some time after gluTessEndPolygon is called.

For example, if the polygon lies in an arbitrary plane in 3-space, and a color is associated with each vertex, the GLU_TESS_COMBINE callback might look like this:

        void myCombine(double[] coords, Object[] data,
                       float[] weight, Object[] outData)
        {
           MyVertex newVertex = new MyVertex();

           newVertex.x = coords[0];
           newVertex.y = coords[1];
           newVertex.z = coords[2];
           newVertex.r = weight[0]*data[0].r +
                         weight[1]*data[1].r +
                         weight[2]*data[2].r +
                         weight[3]*data[3].r;
           newVertex.g = weight[0]*data[0].g +
                         weight[1]*data[1].g +
                         weight[2]*data[2].g +
                         weight[3]*data[3].g;
           newVertex.b = weight[0]*data[0].b +
                         weight[1]*data[1].b +
                         weight[2]*data[2].b +
                         weight[3]*data[3].b;
           newVertex.a = weight[0]*data[0].a +
                         weight[1]*data[1].a +
                         weight[2]*data[2].a +
                         weight[3]*data[3].a;
           outData = newVertex;
        }
Parameters
coords:double[]

Specifics the location of the new vertex.

data:Object[]

Specifics the vertices used to create the new vertex.

weight:float[]

Specifics the weights used to create the new vertex.

outData:Object[]

Reference user the put the coodinates of the new vertex.

endback to summary
public void end()

Overrides org.lwjgl.util.glu.GLUtessellatorCallbackAdapter.end.

Implements org.lwjgl.util.glu.GLUtessellatorCallback.end.

Doc from org.lwjgl.util.glu.GLUtessellatorCallback.end.

The end callback serves the same purpose as glEnd. It indicates the end of a primitive and it takes no arguments.

vertexback to summary
public void vertex(Object vertexData)

Overrides org.lwjgl.util.glu.GLUtessellatorCallbackAdapter.vertex.

Implements org.lwjgl.util.glu.GLUtessellatorCallback.vertex.

Doc from org.lwjgl.util.glu.GLUtessellatorCallback.vertex.

The vertex callback method is invoked between the begin and end callback methods. It is similar to glVertex3f, and it defines the vertices of the triangles created by the tessellation process. The method takes a reference as its only argument. This reference is identical to the opaque reference provided by the user when the vertex was described (see gluTessVertex).

Parameters
vertexData:Object

Specifics a reference to the vertices of the triangles created byt the tessellatin process.