|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectcom.sun.j3d.loaders.lw3d.ParserObject
com.sun.j3d.loaders.lw3d.LwoParser
com.sun.j3d.loaders.lw3d.J3dLwoParser
class J3dLwoParser
This class is responsible for turning Lightwave geometry data into Java3D geometry. It is a subclass of LwoObject and calls that superclass when first instantiated to parse the binary file and turn it into intermediate data structures. J3dLwoParser then goes through those data structures and turns them into Java3D objects. For each ShapeHolder object created by the parent class, this class retrieves the geometry data and associated surface data, creates the appropriate Geometry object (usually IndexedTriangleFanArray, unless the object is points or lines), including calculating normals for the polygons and sets up the Appearance according to the surface parameters (including calculating texture coordinates if necessary).
Field Summary | |
---|---|
(package private) Color3f |
color
|
(package private) Color3f |
diffuseColor
|
(package private) Color3f |
emissiveColor
|
(package private) float[] |
normalCoordsArray
|
(package private) int[] |
normalIndicesArray
|
(package private) Shape3D |
objectShape
|
(package private) java.util.Vector |
objectShapeList
|
(package private) float |
shininess
|
(package private) Color3f |
specularColor
|
Fields inherited from class com.sun.j3d.loaders.lw3d.LwoParser |
---|
blue, coordsArray, currLength, diffuse, facetIndicesArray, facetSizesArray, gloss, green, luminosity, red, shapeList, specular, surfaceList, surfNameList, theReader, transparency |
Fields inherited from class com.sun.j3d.loaders.lw3d.ParserObject |
---|
debugPrinter, EXCEPTION, LINE_TRACE, MISC, NONE, TIME, TRACE, VALUES, WARNING |
Constructor Summary | |
---|---|
J3dLwoParser(java.lang.String fileName,
int debugVals)
Constructor: Calls LwoObject to parse file and create data structures |
|
J3dLwoParser(java.net.URL url,
int debugVals)
|
Method Summary | |
---|---|
(package private) void |
calculateCylindricalTextureCoords(int textureAxis,
Vector3f textureSize,
Vector3f textureCenter,
float[] textureCoords,
int[] textureIndices,
float[] verts,
int[] indices)
See the comments in calculateTextureCoordinates |
(package private) void |
calculatePlanarTextureCoords(int textureAxis,
Vector3f textureSize,
Vector3f textureCenter,
float[] textureCoords,
int[] textureIndices,
float[] verts,
int[] indices)
See the comments in calculateTextureCoordinates |
(package private) void |
calculateSphericalTextureCoords(int textureAxis,
Vector3f textureCenter,
float[] textureCoords,
int[] textureIndices,
float[] verts,
int[] indices)
See the comments in calculateTextureCoordinates |
(package private) void |
calculateTextureCoords(LwoTexture texture,
float[] verts,
int[] indices,
float[] textureCoords,
int[] textureIndices)
Calculate texture coordinates for the geometry given the texture map properties specified in the LwoTexture object |
(package private) void |
createJava3dGeometry()
Turns LwoObject's data structures (created from the binary geometry file) into Java3d objects |
(package private) Shape3D |
getJava3dShape()
|
(package private) java.util.Vector |
getJava3dShapeList()
|
(package private) void |
getSurf(int length)
Creates new LwoSurface object that parses file and gets all surface parameters for a particular surface |
(package private) double |
xyztoh(float x,
float y,
float z)
See the comments in calculateTextureCoordinates |
(package private) double |
xyztop(float x,
float y,
float z)
See the comments in calculateTextureCoordinates |
Methods inherited from class com.sun.j3d.loaders.lw3d.LwoParser |
---|
getAppropriateShape, getPnts, getPols, getSrfs, main, parseFile, skipDetailPolygons |
Methods inherited from class com.sun.j3d.loaders.lw3d.ParserObject |
---|
debugOutput, debugOutputLn |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
float[] normalCoordsArray
int[] normalIndicesArray
Shape3D objectShape
Color3f color
Color3f diffuseColor
Color3f specularColor
Color3f emissiveColor
float shininess
java.util.Vector objectShapeList
Constructor Detail |
---|
J3dLwoParser(java.lang.String fileName, int debugVals) throws java.io.FileNotFoundException
java.io.FileNotFoundException
J3dLwoParser(java.net.URL url, int debugVals) throws java.io.FileNotFoundException
java.io.FileNotFoundException
Method Detail |
---|
void getSurf(int length) throws java.io.FileNotFoundException
LwoParser
getSurf
in class LwoParser
java.io.FileNotFoundException
void createJava3dGeometry() throws IncorrectFormatException
IncorrectFormatException
void calculateTextureCoords(LwoTexture texture, float[] verts, int[] indices, float[] textureCoords, int[] textureIndices)
double xyztoh(float x, float y, float z)
double xyztop(float x, float y, float z)
void calculateSphericalTextureCoords(int textureAxis, Vector3f textureCenter, float[] textureCoords, int[] textureIndices, float[] verts, int[] indices)
void calculateCylindricalTextureCoords(int textureAxis, Vector3f textureSize, Vector3f textureCenter, float[] textureCoords, int[] textureIndices, float[] verts, int[] indices)
void calculatePlanarTextureCoords(int textureAxis, Vector3f textureSize, Vector3f textureCenter, float[] textureCoords, int[] textureIndices, float[] verts, int[] indices)
Shape3D getJava3dShape()
java.util.Vector getJava3dShapeList()
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |