|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object glmodel.GL_OBJ_Reader
public class GL_OBJ_Reader
Based on Object3D.java by Jeremy Adams (elias4444) august 2005 Read an OBJ file into ArrayLists which can then be imported into a final mesh class. This class just loads and holds data, and can be used independently of specific 3D model classes. Populates a "faces" Arraylist with all faces in the mesh. Also stores face groups in the "groups" Arraylist (an Arraylist that contains Group objects). jul 2006: add Group class to hold group faces, materialname and groupname jul 2006: read usemtl command and store material names with groups
Field Summary | |
---|---|
float |
bottompoint
|
java.util.ArrayList |
faces
|
float |
farpoint
|
java.lang.String |
filename
|
java.lang.String |
filepath
|
java.util.ArrayList |
groups
|
float |
leftpoint
|
GLMaterialLib |
materialLib
|
java.lang.String |
materialLibeName
|
float |
nearpoint
|
java.util.ArrayList |
normals
|
float |
rightpoint
|
java.util.ArrayList |
textureCoords
|
float |
toppoint
|
java.util.ArrayList |
vertices
|
Constructor Summary | |
---|---|
GL_OBJ_Reader(java.io.InputStream in)
|
|
GL_OBJ_Reader(java.lang.String objfilename)
|
Method Summary | |
---|---|
void |
calcDimensions()
Find min/max points of mesh. |
int |
convertIndex(java.lang.String token,
int numVerts)
Convert a vertex reference number into the correct vertex array index. |
glmodel.GL_OBJ_Reader.Group |
findGroup(java.lang.String name)
look for the given groupname in the groups list |
java.util.ArrayList |
getGroupFaces(int g)
|
java.lang.String |
getGroupMaterialName(int g)
|
java.lang.String |
getGroupName(int g)
|
int |
getGroupTriangleCount(int g)
|
float |
getXWidth()
|
float |
getYHeight()
|
float |
getZDepth()
|
void |
loadobject(java.io.BufferedReader br)
OBJ file format in a nutshell: First part of file lists vertex data: vert coords, texture coords and normals. |
void |
loadobject(java.io.InputStream in)
|
void |
loadobject(java.lang.String objfilename)
|
int |
numGroups()
|
int |
numpolygons()
|
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
public java.util.ArrayList vertices
public java.util.ArrayList normals
public java.util.ArrayList textureCoords
public java.util.ArrayList faces
public java.util.ArrayList groups
public java.lang.String materialLibeName
public GLMaterialLib materialLib
public java.lang.String filepath
public java.lang.String filename
public float leftpoint
public float rightpoint
public float bottompoint
public float toppoint
public float farpoint
public float nearpoint
Constructor Detail |
---|
public GL_OBJ_Reader(java.lang.String objfilename)
public GL_OBJ_Reader(java.io.InputStream in)
Method Detail |
---|
public void loadobject(java.lang.String objfilename)
public void loadobject(java.io.InputStream in)
public void loadobject(java.io.BufferedReader br)
public glmodel.GL_OBJ_Reader.Group findGroup(java.lang.String name)
name
-
public int convertIndex(java.lang.String token, int numVerts)
token
- a token from the OBJ file containing a numeric value or blank
public void calcDimensions()
public float getXWidth()
public float getYHeight()
public float getZDepth()
public int numpolygons()
public int numGroups()
public java.lang.String getGroupName(int g)
public java.util.ArrayList getGroupFaces(int g)
public java.lang.String getGroupMaterialName(int g)
public int getGroupTriangleCount(int g)
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |