Sweet Home 3D 4.0

com.eteks.sweethome3d.j3d
Class OBJLoader

java.lang.Object
  extended by com.sun.j3d.loaders.LoaderBase
      extended by com.eteks.sweethome3d.j3d.OBJLoader
All Implemented Interfaces:
Loader

public class OBJLoader
extends LoaderBase
implements Loader

An OBJ + MTL loader. It supports the same features as ObjectFile Java 3D class, expected for texture images format (supports only BMP, WBMP, GIF, JPEG and PNG format). Compared to ObjectFile, this class supports transparency as defined in MTL file format specifications, and doesn't oblige to define texture coordinate on all vertices when only one face needs such coordinates. Material description is stored in OBJMaterial instances to be able to use additional OBJ information in other circumstances.
Note: this class is compatible with Java 3D 1.3.

Author:
Emmanuel Puybaret

Field Summary
 
Fields inherited from class com.sun.j3d.loaders.LoaderBase
basePath, baseUrl, loadFlags
 
Fields inherited from interface com.sun.j3d.loaders.Loader
LOAD_ALL, LOAD_BACKGROUND_NODES, LOAD_BEHAVIOR_NODES, LOAD_FOG_NODES, LOAD_LIGHT_NODES, LOAD_SOUND_NODES, LOAD_VIEW_GROUPS
 
Constructor Summary
OBJLoader()
           
 
Method Summary
 Scene load(Reader reader)
          Returns the scene described in the given OBJ file stream.
 Scene load(String file)
          Returns the scene described in the given OBJ file.
 Scene load(URL url)
          Returns the scene described in the given OBJ file url.
 
Methods inherited from class com.sun.j3d.loaders.LoaderBase
getBasePath, getBaseUrl, getFlags, setBasePath, setBaseUrl, setFlags
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 
Methods inherited from interface com.sun.j3d.loaders.Loader
getBasePath, getBaseUrl, getFlags, setBasePath, setBaseUrl, setFlags
 

Constructor Detail

OBJLoader

public OBJLoader()
Method Detail

load

public Scene load(String file)
           throws FileNotFoundException,
                  IncorrectFormatException,
                  ParsingErrorException
Returns the scene described in the given OBJ file.

Specified by:
load in interface Loader
Throws:
FileNotFoundException
IncorrectFormatException
ParsingErrorException

load

public Scene load(URL url)
           throws FileNotFoundException,
                  IncorrectFormatException,
                  ParsingErrorException
Returns the scene described in the given OBJ file url.

Specified by:
load in interface Loader
Throws:
FileNotFoundException
IncorrectFormatException
ParsingErrorException

load

public Scene load(Reader reader)
           throws FileNotFoundException,
                  IncorrectFormatException,
                  ParsingErrorException
Returns the scene described in the given OBJ file stream.

Specified by:
load in interface Loader
Throws:
FileNotFoundException
IncorrectFormatException
ParsingErrorException

Sweet Home 3D 4.0

© Copyrights 2006-2013 eTeks - All rights reserved
Distributed under GNU General Public License