public class Loader3DS
extends LoaderBase
ChunkChopper
is a singleton flyweight factory responsible for
chopping the data up and sending it to the corresponding chunks(which are
flyweights ala the flyweight pattern) for processing.
Features not supported; unknown chunks are skipped.
Constructor and Description |
---|
Loader3DS() |
Modifier and Type | Method and Description |
---|---|
static void |
addDefaultLights(Group group)
Adds defaultlights to the group provided
similar to the ones 3ds max adds when there are none in the scene.
|
boolean |
fromUrl()
Returns true if this loader is loading files
from a url.
|
java.awt.Image |
getTextureImage(java.lang.String imageName)
gets an image with the specified name.
|
Scene |
load(java.io.Reader reader)
This is not supported
|
Scene |
load(java.lang.String modelPath)
Loads the model by parsing the file, modelPath and creating a 3D Scene.
|
Scene |
load(java.net.URL url)
throws UnsupportedOperationException
|
protected Scene |
parseChunks(java.io.InputStream inputStream,
int modelSize)
Gets a chunk chopper to do all the dirty work.
|
void |
setBasePath(java.lang.String pathName)
Set the path where files associated with this .obj file are
located.
|
void |
setTextureImageLoader(TextureImageLoader loader)
Sets the TextureImageLoader to be used
when texture images are needed.
|
void |
turnOnDebug()
Turn on debug mode for all 3ds xml.
|
public Scene load(java.io.Reader reader) throws java.io.FileNotFoundException
reader
- loads a model from a readerjava.io.FileNotFoundException
java.lang.UnsupportedOperationException
public Scene load(java.lang.String modelPath) throws java.io.FileNotFoundException
modelPath
- the path of the 3ds file.java.io.FileNotFoundException
- if the file can't be located.public void setBasePath(java.lang.String pathName)
public boolean fromUrl()
public java.awt.Image getTextureImage(java.lang.String imageName)
imageName
- name of image to load.public void setTextureImageLoader(TextureImageLoader loader)
loader
- the TextureImageLoader that will be used to load images.protected Scene parseChunks(java.io.InputStream inputStream, int modelSize)
inputStream
- the stream containing the model.modelSize
- size of the model file.public static void addDefaultLights(Group group)
group
- to add the lighting to.public Scene load(java.net.URL url) throws java.io.FileNotFoundException
url
- url of model to be loaded.java.io.FileNotFoundException
- if file couldn't be found.public void turnOnDebug()
Copyright © 2000-2016 Microcrowd. All Rights Reserved.