开发者

Java3d resetting to a new scene

开发者 https://www.devze.com 2022-12-11 01:31 出处:网络
I\'m working on a game in Java3D. I read all my level info from a file and it works fine. But now I want to re-initialize the scene from reading data from a different file.

I'm working on a game in Java3D. I read all my level info from a file and it works fine. But now I want to re-initialize the scene from reading data from a different file.

How do I reset the scene?

开发者_如何学运维

Should I just destroy the whole canvas3D and universe objects?


Thanks Mikeb, you put me on the right track.

I figured it out. You need to detach the branchgroup.

Like this:

if (sceneBG != null) {
   sceneBG.detach();
}
sceneBG = new BranchGroup();
sceneBG.setCapability(BranchGroup.ALLOW_DETACH); 
0

精彩评论

暂无评论...
验证码 换一张
取 消