|
j3d.org Code | |||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object org.j3d.util.TriangleUtils
public class TriangleUtils
An set of utility functions for taking basic triangle information and returning derived information that is useful for rendering.
The tangent generation code is derived from Eric Lengyel's Computing Tangent Space Basis Vectors for an Arbitrary Mesh http://www.terathon.com/code/tangent.html
Internationalisation Resource Names
Constructor Summary | |
---|---|
TriangleUtils()
|
Method Summary | |
---|---|
static void |
createTangents(int numTriangles,
float[] coords,
float[] normals,
float[] texCoords,
float[] tangents)
Generate tangent space vectors and Binormals (Bitangents). |
static void |
createTangents(int numTriangles,
int[] indices,
float[] coords,
float[] normals,
float[] texCoords,
float[] tangents)
Generate tangent space vectors and Binormals (Bitangents). |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public TriangleUtils()
Method Detail |
---|
public static void createTangents(int numTriangles, int[] indices, float[] coords, float[] normals, float[] texCoords, float[] tangents)
numTriangles
- The number of triangles to process from the
index list - assuming indexed triangles and nothing more fancy
like strips or fansindices
- The list of vertex indices where each i is the
index, not multiplying in the 3x for flattened coordscoords
- The list of coordinates to process as a flat listnormals
- The list of normals, one per vertex, flattenedtexCoords
- The list of 2D texture coordinates, one per
vertex, flattenedtangents
- The array to put the returned tangents in, must
be 4x the number of coordinates as it is provided in x,y,z,w
form
java.lang.NullPointerException
- One of the arrays provided was
null. Message contains the details of which onepublic static void createTangents(int numTriangles, float[] coords, float[] normals, float[] texCoords, float[] tangents)
numTriangles
- The number of triangles to process -
assuming a triangle arraycoords
- The list of coordinates to process as a flat listnormals
- The list of normals, one per vertex, flattenedtexCoords
- The list of 2D texture coordinates, one per
vertex, flattenedtangents
- The array to put the returned tangents in, must
be 4x the number of coordinates as it is provided in x,y,z,w
form
java.lang.NullPointerException
- One of the arrays provided was
null. Message contains the details of which one
|
j3d.org Code | |||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |