j3d.org Code

org.j3d.loaders.discreet
Class TriangleMesh

java.lang.Object
  extended by org.j3d.loaders.discreet.TriangleMesh

public class TriangleMesh
extends java.lang.Object

Representation of a single triangle mesh.

A triangle mesh consists of vertices, face sets connecting the vertices, and a single set of 2D texture coordinates (multitexture not supported by the .3ds format). Tangent and binormals are calculated on the fly from the provided information. The file definition of this chunk is:

 TRIANGULAR MESH 0x4100
     VERTICES LIST 0x4110
     FACES DESCRIPTION 0x4120
         FACES MATERIAL 0x4130
     MAPPING COORDINATES LIST 0x4140
     SMOOTHING GROUP LIST 0x4150
     LOCAL COORDINATES SYSTEM 0x4160
 

Version:
$Revision: 1.3 $
Author:
Justin Couch

Field Summary
 float[] binormals
          Listing of binormals for each vertex
 java.lang.String[] boxMapMaterials
          Names of the materials used for a cubic environment map.
 int[] faces
          Index lists for each face
 float[] localCoords
          Local coordinate system reference (a 4x3 matrix)
 MaterialData[] materials
          Listing of the material groups needed
 float[] normals
          Listing of normals for each vertex
 int numFaces
          Total number of valid faces.
 int numMaterials
          Number of valid material groups available
 int numTexCoords
          The number of texture coordinates
 int numVertices
          The number of valid vertices in this mesh
 int[] smoothgroups
          Index lists for the groups of faces that should be smooth shaded
 float[] tangents
          Listing of tangents for each vertex
 float[] texCoords
          2D texture coordinates for this object
 float[] vertices
          Vertex coordinates, flat style
 
Constructor Summary
TriangleMesh()
           
 
Method Summary
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

vertices

public float[] vertices
Vertex coordinates, flat style


numVertices

public int numVertices
The number of valid vertices in this mesh


texCoords

public float[] texCoords
2D texture coordinates for this object


numTexCoords

public int numTexCoords
The number of texture coordinates


faces

public int[] faces
Index lists for each face


numFaces

public int numFaces
Total number of valid faces.


smoothgroups

public int[] smoothgroups
Index lists for the groups of faces that should be smooth shaded


normals

public float[] normals
Listing of normals for each vertex


tangents

public float[] tangents
Listing of tangents for each vertex


binormals

public float[] binormals
Listing of binormals for each vertex


localCoords

public float[] localCoords
Local coordinate system reference (a 4x3 matrix)


materials

public MaterialData[] materials
Listing of the material groups needed


numMaterials

public int numMaterials
Number of valid material groups available


boxMapMaterials

public java.lang.String[] boxMapMaterials
Names of the materials used for a cubic environment map. This will be mapped in the order: front, back, left, right, top, bottom. Will be null if nothing declared.

Constructor Detail

TriangleMesh

public TriangleMesh()

j3d.org Code

Latest Info from http://code.j3d.org/
Copyright © 2001 - j3d.org