Class edu.calpoly.smetzger.j3d.loaders.ObjectFile
java.lang.Object
|
+----javax.media.j3d.SceneGraphObject
|
+----javax.media.j3d.Node
|
+----javax.media.j3d.Group
|
+----edu.calpoly.smetzger.j3d.loaders.Assembly
|
+----edu.calpoly.smetzger.j3d.loaders.ObjectFile
- public class ObjectFile
- extends Assembly
This class extends the Assembly class. It allows parses an Wavefront Obj file
and creates a Assembly object.
The ACSII Obj file defines individual polygons and looks like:
#Simple wavefront file
v 0.0 0.0 0.0
v 0.0 0.0 0.0
v 0.0 0.0 0.0
g triangle
f 1 2 3
The currently supported tags are v, f, g, mtllib, usemtl, Ka, Ks, Kd, and sharpness.
The normals are ignored and regenerated. Textures are not yet supported
|
Field Summary
|
|
static int
|
RESIZE
Flag for automatic resizing Assembly to fit in the viewport
|
|
static int
|
REVERSE
Flag for reversing the order of the vertices
|
|
static int
|
TRIANGULATE
Flag for triangulation used if their are more than three vertexes per facet
|
|
static int
|
VERBOSE
|
| Fields inherited from class edu.calpoly.smetzger.j3d.loaders.Assembly
|
| REVERSE |
| Fields inherited from class javax.media.j3d.Group
|
| ALLOW_CHILDREN_EXTEND, ALLOW_CHILDREN_READ, ALLOW_CHILDREN_WRITE, ALLOW_COLLISION_BOUNDS_READ, ALLOW_COLLISION_BOUNDS_WRITE |
| Fields inherited from class javax.media.j3d.Node
|
| ALLOW_AUTO_COMPUTE_BOUNDS_READ, ALLOW_AUTO_COMPUTE_BOUNDS_WRITE, ALLOW_BOUNDS_READ, ALLOW_BOUNDS_WRITE, ALLOW_COLLIDABLE_READ, ALLOW_COLLIDABLE_WRITE, ALLOW_LOCAL_TO_VWORLD_READ, ALLOW_PICK, ALLOW_PICKABLE_READ, ALLOW_PICKABLE_WRITE, ENABLE_COLLISION_REPORTING, ENABLE_PICK_REPORTING |
|
Constructor Summary
|
ObjectFile(java.lang.String fileName,
int flags)
Instantiate the class with the filename with flags.
|
ObjectFile(java.io.File objFile,
int flags)
Instantiate the class with the filename with flags.
|
ObjectFile(java.lang.String fileName,
int flags,
float creaseAngle)
Instantiate the class with the filename and flags.
|
ObjectFile(java.io.File objFile,
int flags,
float creaseAngle)
Instantiate the class with the filename and flags.
|
| Methods inherited from class javax.media.j3d.Group
|
| addChild, cloneNode, duplicateNode, getAllChildren, getAlternateCollisionTarget, getChild, getCollisionBounds, insertChild, moveTo, numChildren, removeChild, setAlternateCollisionTarget, setChild, setCollisionBounds |
| Methods inherited from class javax.media.j3d.Node
|
| cloneNode, cloneTree, cloneTree, cloneTree, duplicateNode, getBounds, getBoundsAutoCompute, getCollidable, getLocalToVworld, getLocalToVworld, getParent, getPickable, setBounds, setBoundsAutoCompute, setCollidable, setPickable |
| Methods inherited from class javax.media.j3d.SceneGraphObject
|
| clearCapability, getCapability, getUserData, isCompiled, isLive, setCapability, setUserData |
| Methods inherited from class java.lang.Object
|
| clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
RESIZE
public static final int RESIZE
- Flag for automatic resizing Assembly to fit in the viewport
TRIANGULATE
public static final int TRIANGULATE
- Flag for triangulation used if their are more than three vertexes per facet
REVERSE
public static final int REVERSE
- Flag for reversing the order of the vertices
VERBOSE
public static final int VERBOSE
ObjectFile
public ObjectFile(java.lang.String fileName,
int flags) throws java.io.IOException, LoaderException
- Instantiate the class with the filename with flags.
- Parameters:
fileName
- name of the input file
flags
- |= together include REVERSE, RESIZE, and VERBOSE
- Throws:
- LoaderException - for syntactic errors
ObjectFile
public ObjectFile(java.io.File objFile,
int flags) throws java.io.IOException, LoaderException
- Instantiate the class with the filename with flags.
- Parameters:
objFile
- Java.io.File object for input
flags
- |= together include REVERSE, RESIZE, and VERBOSE
- Throws:
- LoaderException - for syntactic errors
ObjectFile
public ObjectFile(java.lang.String fileName,
int flags,
float creaseAngle) throws java.io.IOException, LoaderException
- Instantiate the class with the filename and flags.
- Parameters:
fileName
- name of the input file
flags
- |= together include REVERSE, RESIZE, and VERBOSE
creaseAngle
- minimum angle to share normals
- Throws:
- LoaderException - for syntactic errors
ObjectFile
public ObjectFile(java.io.File objFile,
int flags,
float creaseAngle) throws java.io.IOException, LoaderException
- Instantiate the class with the filename and flags.
- Parameters:
objFile
- Java.io.File object for input
flags
- |= together include REVERSE, RESIZE, and VERBOSE
creaseAngle
- minimum angle to share normals
- Throws:
- LoaderException - for syntactic errors