How can I set the bounds on a SimpleUniverse instance created with a canvas3d object?
I tried the code below, but I get either a "Capability not set exception" if I try to set the bounds and a "Restricted access exception" if I try to set the capability to write bounds.
Here's my code:
GraphicsConfiguration config = SimpleUniverse.getPreferredConfiguration();
Canvas3D canvas3d = new Canvas3D(config);
SimpleUniverse universe = new SimpleUniverse(canvas3d);
ViewingPlatform viewPlatform = universe.getViewingPlatform();
// Below line throws RestricedAccessException
viewPlatform.setCapability(ViewingPlatform.ALLOW_BOUNDS_WRITE);
// I want to set the bounds, thus the need for the capability above
viewPlatform.setBounds(bounds);
Please help!