2
如何在使用canvas3d對象創建的SimpleUniverse實例上設置邊界?如何在Java 3d中設置Universe的功能?
我試過下面的代碼,但是如果我嘗試設置邊界和「限制訪問異常」,如果我嘗試設置寫入邊界的能力,我會得到「能力未設置異常」。
這裏是我的代碼:
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);
請幫幫忙!