// the SimpleUniverse.
public void createSceneGraph(SimpleUniverse su) {
// Load an obj-file.
ObjectFile f = new ObjectFile(ObjectFile.RESIZE);
Scene s = null;
try {
s = f.load("./eas/miscellaneous/java3D/schiff.obj");
} catch (Exception e) {
System.out.println("File loading failed:" + e);
}
// Generate a transformation group for the loaded object.
Transform3D tfObject = new Transform3D();
tfObject.rotZ(0.4 * Math.PI);
Transform3D xRotation = new Transform3D();
xRotation.rotY(0.4 * Math.PI);
tfObject.mul(xRotation);
TransformGroup tgObject = new TransformGroup(tfObject);
tgObject.addChild(s.getSceneGroup());
// In the following way, the names of the parts of the object can be
// obtained. The names are printed.
Hashtable namedObjects = s.getNamedObjects();
Enumeration enumer = namedObjects.keys();
String name;
while (enumer.hasMoreElements()) {
name = (String) enumer.nextElement();
System.out.println("Name: " + name);