|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectjavax.media.ding3d.loaders.objectfile.ObjectFile
public class ObjectFile
The ObjectFile class implements the Loader interface for the Wavefront .obj file format, a standard 3D object file format created for use with Wavefront's Advanced Visualizer (tm) and available for purchase from Viewpoint DataLabs, as well as other 3D model companies. Object Files are text based files supporting both polygonal and free-form geometry (curves and surfaces). The Java 3D .obj file loader supports a subset of the file format, but it is enough to load almost all commonly available Object Files. Free-form geometry is not supported.
The Object File tokens currently supported by this loader are:v float float float
vn float float float
vt float float
f int int int . . .
f int/int int/int int/int . . .
f int/int/int int/int/int int/int/int . . .
g name
s int
s off
usemtl name
amber amber_trans aqua aqua_filter
archwhite archwhite2 bflesh black
blondhair blue_pure bluegrey bluetint
blugrn blutan bluteal bone
bone1 bone2 brass brnhair
bronze brown brownlips brownskn
brzskin chappie charcoal deepgreen
default dkblue dkblue_pure dkbrown
dkdkgrey dkgreen dkgrey dkorange
dkpurple dkred dkteal emerald
fgreen flaqua flblack flblonde
flblue_pure flbrown fldkblue_pure fldkdkgrey
fldkgreen fldkgreen2 fldkgrey fldkolivegreen
fldkpurple fldkred flesh fleshtransparent
flgrey fllime flltbrown flltgrey
flltolivegreen flmintgreen flmustard florange
flpinegreen flpurple flred fltan
flwhite flwhite1 flyellow glass
glassblutint glasstransparent gold green
greenskn grey hair iris
jetflame lavendar lcdgreen lighttan
lighttan2 lighttan3 lighttannew lightyellow
lime lips ltbrown ltgrey
meh metal mintgrn muscle
navy_blue offwhite.cool offwhite.warm olivegreen
orange pale_green pale_pink pale_yellow
peach periwinkle pink pinktan
plasma purple red redbrick
redbrown redorange redwood rubber
ruby sand_stone sapphire shadow
ship2 silver skin sky_blue
smoked_glass tan taupe teeth
violet white yellow yellow_green
yellowbrt yelloworng
mtllib filename
newmtl name
Ka float float float
Kd float float float
Ks float float float
illum (0, 1, or 2)
Ns float
map_Kd filename
| Field Summary | |
|---|---|
static int |
RESIZE
Flag sent to constructor. |
static int |
REVERSE
Flag sent to constructor. |
static int |
STRIPIFY
Flag sent to contructor. |
static int |
TRIANGULATE
Flag sent to constructor. |
| Fields inherited from interface javax.media.ding3d.loaders.Loader |
|---|
LOAD_ALL, LOAD_BACKGROUND_NODES, LOAD_BEHAVIOR_NODES, LOAD_FOG_NODES, LOAD_LIGHT_NODES, LOAD_SOUND_NODES, LOAD_VIEW_GROUPS |
| Constructor Summary | |
|---|---|
ObjectFile()
Default constructor. |
|
ObjectFile(int flags)
Constructor. |
|
ObjectFile(int flags,
float radians)
Constructor. |
|
| Method Summary | |
|---|---|
java.lang.String |
getBasePath()
Return the path where files associated with this .obj file (like material files) are located. |
java.net.URL |
getBaseUrl()
Return the URL where files associated with this .obj file (like material properties files) will be found. |
int |
getFlags()
Get the parameters currently defined for loading the model. |
Scene |
load(java.io.Reader reader)
The Object File is loaded from the already opened file. |
Scene |
load(java.lang.String filename)
The Object File is loaded from the .obj file specified by the filename. |
Scene |
load(java.net.URL url)
The object file is loaded off of the web. |
void |
setBasePath(java.lang.String pathName)
Set the path where files associated with this .obj file are located. |
void |
setBaseUrl(java.net.URL url)
For an .obj file loaded from a URL, set the URL where associated files (like material properties files) will be found. |
void |
setFlags(int flags)
Set parameters for loading the model. |
| Methods inherited from class java.lang.Object |
|---|
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Field Detail |
|---|
public static final int RESIZE
public static final int TRIANGULATE
public static final int REVERSE
public static final int STRIPIFY
| Constructor Detail |
|---|
public ObjectFile(int flags,
float radians)
flags - The constants from above or from
javax.media.ding3d.loaders.Loader, possibly "or'ed" (|) together.radians - Ignored if the vn token is present in the model (user
normals supplied). Otherwise, crease angle to use within smoothing
groups, or within geometry groups if the s token isn't present either.public ObjectFile(int flags)
flags - The constants from above or from
javax.media.ding3d.loaders.Loader, possibly "or'ed" (|) together.public ObjectFile()
| Method Detail |
|---|
public Scene load(java.lang.String filename)
throws java.io.FileNotFoundException,
IncorrectFormatException,
ParsingErrorException
load in interface Loaderjava.io.FileNotFoundException
IncorrectFormatException
ParsingErrorException
public Scene load(java.net.URL url)
throws java.io.FileNotFoundException,
IncorrectFormatException,
ParsingErrorException
load in interface Loaderjava.io.FileNotFoundException
IncorrectFormatException
ParsingErrorException
public Scene load(java.io.Reader reader)
throws java.io.FileNotFoundException,
IncorrectFormatException,
ParsingErrorException
load in interface Loaderjava.io.FileNotFoundException
IncorrectFormatException
ParsingErrorExceptionpublic void setBaseUrl(java.net.URL url)
setBaseUrl in interface Loaderpublic java.net.URL getBaseUrl()
getBaseUrl in interface Loaderpublic void setBasePath(java.lang.String pathName)
setBasePath in interface Loaderpublic java.lang.String getBasePath()
getBasePath in interface Loaderpublic void setFlags(int flags)
setFlags in interface Loaderpublic int getFlags()
getFlags in interface Loader
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||