Class Load3DS

java.lang.Object
  |
  +--Load3DS

public class Load3DS
extends java.lang.Object

.3DS format model loader for Java3D.


Constructor Summary
Load3DS(java.lang.String filename, java.awt.Component component, java.util.Hashtable objects, java.util.Hashtable instances, java.util.Properties properties)
          Given a filename, Load3DS will construct an appropriate Java3D scene graph - accessible from Load3DS.root().
 
Method Summary
 javax.media.j3d.BranchGroup root()
          Returns the root of the scene graph constructed from the given file.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

Load3DS

public Load3DS(java.lang.String filename,
               java.awt.Component component,
               java.util.Hashtable objects,
               java.util.Hashtable instances,
               java.util.Properties properties)
        throws java.io.IOException

Given a filename, Load3DS will construct an appropriate Java3D scene graph - accessible from Load3DS.root(). It also constructs a table of objects, indexed by their proper name and a table of of those objects which are refered to by ther instance name. Currently, only two are returned, "polygons" and "vertices", the value of which are a java.lang.Integer giving the total number of polygons and vertices in the .3DS file respectively.

Limitations of the current version:

  • Lights are not created.
  • Interpretation of 3DS's shininess and shininess strength could be better.
  • Only handles those texture map image formats supported by com.sun.j3d.utils.image.TextureLoader.
  • Java3Disms:

  • 3DS wireframe material = PolygonAttributes.POLYGON_LINE
  • 3DS metal-shaded material = PolygonAttributes.POLYGON_POINT
  • 3DS constant-shaded material = PolygonAttributes.POLYGON_FILL
  • 3DS phong-shaded material = PolygonAttributes.POLYGON_PHONG
  • Hidden objects don't seem to be set by 3DSMax. Load3DS simulates this by hiding objects whose names begin with '$'.
  • Note that only 3DS planar mapping generates correct 2D texture coords.
  • 1 generic 3DSMax unit = 1 Java3D unit. This loader does not handle other 3DSMax units, e.g. metric.
  • Known bugs:

  • Normal calculation fails for certain surfaces.
  • Parameters:
    filename - .3DS file to load.
    component - parent java.awt.Component (needed by com.sun.j3d.utils.image.TextureLoader).
    objects - table of named objects indexed by object name. name-value pairs are a string and a SharedGroup respectively.
    instances - table of instanced objects indexed by instance name. name-value pairs are a string and a TransformGroup respectively.
    properties - information about the .3DS file.
    Throws:
    java.io.IOException - any failure to process .3DS file.
    See Also:
    TextureLoader
    Method Detail

    root

    public javax.media.j3d.BranchGroup root()
    Returns the root of the scene graph constructed from the given file.
    Returns:
    Root of constructed scene graph.