Posted by
runiter on
Feb 22, 2014; 5:09pm
URL: https://forum.jogamp.org/Canvas3D-resize-problem-tp4031602p4031690.html
I never really programmed directly in JOGL before so it will be difficult for me to come up with a test case that breaks it the way Java3D breaks it. Looks to me that JOGL seem to function fine by itself so perhaps Java3D needs to update the way it calls JOGL to be consistent with the new way JOGL initiates.
Meanwhile this is the Java3D test case I have. I removed all calls to my own application so it's pure Java3D. It still crashes upon call to new SimpleUniverse().
Testcase jnlp:
http://www.runiter.com/webstart/test_gc3/grapher.jnlpTestcase Source Code:
package runiter.grapher;
import javax.media.j3d.BranchGroup;
import javax.swing.JOptionPane;
import sun.awt.AppContext;
import sun.awt.SunToolkit;
import com.sun.j3d.utils.geometry.ColorCube;
import com.sun.j3d.utils.universe.SimpleUniverse;
public class MainApplication {
public static void main(final String[] args) {
try {
System.out.println("Initiating...");
JOptionPane.showMessageDialog(null, "AppContext.getAppContext() = " + AppContext.getAppContext());
if(AppContext.getAppContext() == null){
SunToolkit.createNewAppContext();
JOptionPane.showConfirmDialog(null, "AppContext.getAppContext() was null. It was recreated!");
JOptionPane.showMessageDialog(null, "AppContext.getAppContext() = " + AppContext.getAppContext());
}
JOptionPane.showMessageDialog(null, "final SimpleUniverse universe = new SimpleUniverse();");
final SimpleUniverse universe = new SimpleUniverse();
JOptionPane.showMessageDialog(null, "final BranchGroup group = new BranchGroup();");
final BranchGroup group = new BranchGroup();
JOptionPane.showMessageDialog(null, "group.addChild(new ColorCube(0.3));");
group.addChild(new ColorCube(0.3));
JOptionPane.showMessageDialog(null, "universe.getViewingPlatform().setNominalViewingTransform();");
universe.getViewingPlatform().setNominalViewingTransform();
JOptionPane.showMessageDialog(null, "universe.addBranchGraph(group);");
universe.addBranchGraph(group);
} catch (final Throwable e) {
e.printStackTrace();
JOptionPane.showMessageDialog(null, "Exception Occured: " + e.getMessage());
}
}
}