|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectsim.portrayal3d.SimplePortrayal3D
sim.portrayal3d.simple.PrimitivePortrayal3D
sim.portrayal3d.simple.BranchGroupPortrayal3D
public class BranchGroupPortrayal3D
Loads a Lightwave 3D scene file (.lwo or .lws extension) or a Wavefront object file (.obj extension) into a BranchGroup, then attaches this as a portrayal. All scene elements and attributes are loaded (fog, sound, etc. as well). Generally all geometry in the scene is loaded as a Shape3D. If an Appearance is specified in the constructor, it is applied to all Shape3D objects in the scene. Else they are left with the appearance specified in the file.
You can also use other loaders for other scene file formats. NCSA Portfolio contains a large number of them, but it's not quite open source (free for academic, research, or internal business use). See the MASON website for a link to download and use the NCSA Portfolio library.
Field Summary |
---|
Fields inherited from class sim.portrayal3d.simple.PrimitivePortrayal3D |
---|
group |
Fields inherited from class sim.portrayal3d.SimplePortrayal3D |
---|
DEFAULT_APPEARANCE |
Constructor Summary | |
---|---|
BranchGroupPortrayal3D(javax.media.j3d.BranchGroup scene)
Constructs a BranchGroupPortrayal3D with the given scene file loader without changing its appearance, scale, or transform. |
|
BranchGroupPortrayal3D(javax.media.j3d.BranchGroup scene,
javax.media.j3d.Appearance a)
Constructs a BranchGroupPortrayal3D with the given scene file loader without transforming it or scaling it, but changing its appearance (unless the appearance is null). |
|
BranchGroupPortrayal3D(javax.media.j3d.BranchGroup scene,
double scale)
Constructs a BranchGroupPortrayal3D with the given scene file loader without changing its appearance, but scaling it. |
|
BranchGroupPortrayal3D(javax.media.j3d.BranchGroup scene,
double scale,
javax.media.j3d.Appearance a)
Constructs a BranchGroupPortrayal3D with the given scene file loader by scaling it and changing its appearance (unless the appearance is null). |
|
BranchGroupPortrayal3D(javax.media.j3d.BranchGroup scene,
javax.media.j3d.Transform3D transform)
Constructs a BranchGroupPortrayal3D with the given scene file loader without changing its appearance, but transforming it. |
|
BranchGroupPortrayal3D(javax.media.j3d.BranchGroup scene,
javax.media.j3d.Transform3D transform,
javax.media.j3d.Appearance a)
Constructs a BranchGroupPortrayal3D with the given scene file loader by transforming it and changing its appearance (unless the appearance is null). |
Method Summary | |
---|---|
static javax.media.j3d.BranchGroup |
getBranchGroupForFile(java.lang.String filename)
|
static javax.media.j3d.BranchGroup |
getBranchGroupForResource(java.lang.Class c,
java.lang.String resourceName)
|
static javax.media.j3d.BranchGroup |
getBranchGroupForURL(java.net.URL url)
|
javax.media.j3d.TransformGroup |
getModel(java.lang.Object obj,
javax.media.j3d.TransformGroup j3dModel)
We suggest that if you wish to override this to change the appearance or scale or transform of the underlying model, do the changes first and THEN call super.getModel(obj, j3dModel). |
protected int |
numShapes()
Unused: returns 0 always. |
Methods inherited from class sim.portrayal3d.simple.PrimitivePortrayal3D |
---|
getAppearance, getShape, setAppearance, setPickable, setScale, setShape3DFlags, setTransform |
Methods inherited from class sim.portrayal3d.SimplePortrayal3D |
---|
appearanceForColor, appearanceForColors, appearanceForImage, clearPickableFlags, getCurrentDisplay, getCurrentFieldPortrayal, getCurrentGUIState, getInspector, getName, getStatus, isSelected, polygonAttributes, setAppearanceFlags, setCurrentDisplay, setCurrentFieldPortrayal, setPickableFlags, setPickableFlags, setSelected |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public BranchGroupPortrayal3D(javax.media.j3d.BranchGroup scene)
public BranchGroupPortrayal3D(javax.media.j3d.BranchGroup scene, double scale)
public BranchGroupPortrayal3D(javax.media.j3d.BranchGroup scene, javax.media.j3d.Transform3D transform)
public BranchGroupPortrayal3D(javax.media.j3d.BranchGroup scene, javax.media.j3d.Appearance a)
public BranchGroupPortrayal3D(javax.media.j3d.BranchGroup scene, double scale, javax.media.j3d.Appearance a)
public BranchGroupPortrayal3D(javax.media.j3d.BranchGroup scene, javax.media.j3d.Transform3D transform, javax.media.j3d.Appearance a)
Method Detail |
---|
public static javax.media.j3d.BranchGroup getBranchGroupForResource(java.lang.Class c, java.lang.String resourceName) throws java.lang.IllegalArgumentException, java.io.FileNotFoundException
java.lang.IllegalArgumentException
java.io.FileNotFoundException
public static javax.media.j3d.BranchGroup getBranchGroupForURL(java.net.URL url) throws java.lang.IllegalArgumentException, java.io.FileNotFoundException
java.lang.IllegalArgumentException
java.io.FileNotFoundException
public static javax.media.j3d.BranchGroup getBranchGroupForFile(java.lang.String filename) throws java.lang.IllegalArgumentException, java.io.FileNotFoundException
java.lang.IllegalArgumentException
java.io.FileNotFoundException
public javax.media.j3d.TransformGroup getModel(java.lang.Object obj, javax.media.j3d.TransformGroup j3dModel)
PrimitivePortrayal3D
getModel
in interface Portrayal3D
getModel
in class PrimitivePortrayal3D
protected int numShapes()
numShapes
in class PrimitivePortrayal3D
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |