如何设置使用 canvas3d 对象创建的 SimpleUniverse 实例的边界?
我尝试了下面的代码,但如果我尝试设置边界,我会得到“能力未设置异常”,如果我尝试设置写入边界的能力,则会得到“受限访问异常”。
这是我的代码:
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);
请帮忙!