public class ObjectFile extends Object implements Loader
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
Modifier and Type | Field and Description |
---|---|
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.
|
LOAD_ALL, LOAD_BACKGROUND_NODES, LOAD_BEHAVIOR_NODES, LOAD_FOG_NODES, LOAD_LIGHT_NODES, LOAD_SOUND_NODES, LOAD_VIEW_GROUPS
Constructor and Description |
---|
ObjectFile()
Default constructor.
|
ObjectFile(int flags)
Constructor.
|
ObjectFile(int flags,
float radians)
Constructor.
|
Modifier and Type | Method and Description |
---|---|
String |
getBasePath()
Return the path where files associated with this .obj file (like material
files) are located.
|
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(Reader reader)
The Object File is loaded from the already opened file.
|
Scene |
load(String filename)
The Object File is loaded from the .obj file specified by
the filename.
|
Scene |
load(URL url)
The object file is loaded off of the web.
|
void |
setBasePath(String pathName)
Set the path where files associated with this .obj file are
located.
|
void |
setBaseUrl(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.
|
public static final int RESIZE
public static final int TRIANGULATE
public static final int REVERSE
public static final int STRIPIFY
public ObjectFile(int flags, float radians)
flags
- The constants from above or from
org.scijava.java3d.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
org.scijava.java3d.loaders.Loader, possibly "or'ed" (|) together.public ObjectFile()
public Scene load(String filename) throws FileNotFoundException, IncorrectFormatException, ParsingErrorException
load
in interface Loader
FileNotFoundException
IncorrectFormatException
ParsingErrorException
public Scene load(URL url) throws FileNotFoundException, IncorrectFormatException, ParsingErrorException
load
in interface Loader
FileNotFoundException
IncorrectFormatException
ParsingErrorException
public Scene load(Reader reader) throws FileNotFoundException, IncorrectFormatException, ParsingErrorException
load
in interface Loader
FileNotFoundException
IncorrectFormatException
ParsingErrorException
public void setBaseUrl(URL url)
setBaseUrl
in interface Loader
public URL getBaseUrl()
getBaseUrl
in interface Loader
public void setBasePath(String pathName)
setBasePath
in interface Loader
public String getBasePath()
getBasePath
in interface Loader
public void setFlags(int flags)
public int getFlags()
Copyright © 2016–2022 SciJava. All rights reserved.