开发者

Java3d resetting to a new scene

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

上一篇:

下一篇:

精彩评论

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

最新问答

问答排行榜