|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Object | +--GLModel
Store and render a textured mesh. Can load 3DS and OBJ formats.
NOTE: OBJ doesn't load texture coords. Need to debug.
Uses the IDX3D library to load and hold 3DS meshes. See http://www.idx3d.ch for the complete pure-java 3D library by Peter Walser.
napier at potatoland dot org
| Field Summary | |
static int |
SIZE_BYTE
|
static int |
SIZE_DOUBLE
|
static int |
SIZE_FLOAT
|
static int |
SIZE_INT
|
static float |
tileFactorHoriz
|
static float |
tileFactorVert
|
| Constructor Summary | |
GLModel()
|
|
GLModel(java.lang.String filename)
|
|
| Method Summary | |
void |
calculateNormals()
|
void |
commitChanges()
|
static java.io.InputStream |
getInputStream(java.lang.String filename)
Open a file InputStream and trap errors. |
void |
loadMesh(java.lang.String filename)
|
void |
makeDisplayList()
Compile the mesh into display list |
void |
render()
Draw this mesh with current texture |
static void |
renderCube()
Render a unit cube, using current color, texture and material. |
static void |
renderMesh(idx3d_Object o)
Basic mesh render function, using current color, material and texture. |
static void |
renderMesh(idx3d_Object o,
int textureHandle)
Render a mesh with the given texture. |
static void |
renderMeshOBJ(idx3d_Object o,
int textureHandle)
Render OBJ mesh (may have multiple texture coords per vert!!??!!) |
static void |
renderSphere()
Render a unit sphere at the origin, using current color, texture and material. |
void |
rotate(float dx,
float dy,
float dz)
|
void |
scale(float dx,
float dy,
float dz)
Functions to alter mesh size, position, orientation. |
void |
setTexture(int textureHandle)
Set texture for mesh. |
void |
setTextureTile(float horizontalTile,
float verticalTile)
How many times to repeat texture horizontally and vertically. |
void |
sortTriangles()
|
static idx3d_Triangle[] |
sortTriangles(idx3d_Triangle[] tri,
int L,
int R)
Sort an array of triangles by Z depth. |
void |
translate(float dx,
float dy,
float dz)
|
| Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Field Detail |
public static final int SIZE_DOUBLE
public static final int SIZE_FLOAT
public static final int SIZE_INT
public static final int SIZE_BYTE
public static float tileFactorVert
public static float tileFactorHoriz
| Constructor Detail |
public GLModel()
public GLModel(java.lang.String filename)
| Method Detail |
public void loadMesh(java.lang.String filename)
public void scale(float dx,
float dy,
float dz)
public void translate(float dx,
float dy,
float dz)
public void rotate(float dx,
float dy,
float dz)
public void commitChanges()
public void setTextureTile(float horizontalTile,
float verticalTile)
public void setTexture(int textureHandle)
public void render()
public void makeDisplayList()
public void calculateNormals()
public void sortTriangles()
public static void renderMesh(idx3d_Object o,
int textureHandle)
o - textureHandle - public static void renderMesh(idx3d_Object o)
o -
public static void renderMeshOBJ(idx3d_Object o,
int textureHandle)
o -
public static idx3d_Triangle[] sortTriangles(idx3d_Triangle[] tri,
int L,
int R)
To use: sortTriangles(triangleArray, 0, triangleArray.length-1);
public static void renderCube()
public static void renderSphere()
public static java.io.InputStream getInputStream(java.lang.String filename)
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||