How to use a reader
From JReality Wiki
Input
de.jreality.util.Input
is a utility class that unifies the handling of files, URLs and general InputStreams. The most convenient way to create an Input
is the method
Input.getInput(String resourceName)
The resourceName may either be:
- a URL (for instance http://www.foo.com/file.png)
- a relative path (for instance ./foo/file.png)
- an absolute path
For a detailed description, see the javadoc of Input
.
Readers
The static method de.jreality.reader.Readers.read(Input input)
determines the file format based on the ending of the resource name of the input. For files and URLs it will decide from the file ending which reader to use. This works for instance for ".obj" or ".3ds"-files and for many others.
The code is:
Input input = Input.getInput("demofile.obj"); SceneGraphComponent content = Readers.read(input);