NCSA Portfolio Java3D Libraries

MASON's sim/portrayal3d/simple/BranchPortrayal3D class can load and use 3D scene and object files given the right loader software. Unfortunately Java3D only provides two such software: for Alias Wavefront OBJ files and Lightwave LWO and LWS files respectively. The NCSA Portfolio Java3D library extends this to a large number of file types.

NCSA Portfolio contains a lot of useful Java3D extensions. But for our purposes the crucial class is ncsa.j3d.loaders.ModelLoader file, which can be used with BranchPortrayal3D to load a variety of files like this:

ncsa.j3d.loaders.ModelLoader loader = new ncsa.j3d.loaders.ModelLoader();

    // then either ...
com.sun.j3d.loaders.Scene scene = loader.load(new"URL to your scene file"));
    // or...
com.sun.j3d.loaders.Scene scene = loader.load("File Name for your scene file");

BranchGroupPortrayal3D bgp = new BranchGroupPortrayal3D(scene.getSceneGroup());
    // or some other BranchGroupPortrayal3D constructor

NCSA Portfolio used to be under a non-open-source license, but we are proud to announce that NCSA and the University of Illinois have agreed to rerelease it under the Apache 2.0 license. Also note that NCSA Portfolio's original source has been lost: the new source code, which can be found as part of the provided Jar file, is decompiled from the original binaries.

The Files