Primitive をつけたり消したりする
3次元でイジング模型およびスピングラスの シミュレーションを可視化するために Primitive (具体的には Sphere) を つけたり消したりする方法を考えてみた。
- BranchGroup の下につけて、detach / addChild を繰り返す。
- 透明な Appearance を用意して、Appearance を取り換える。
Appearance app = new Appearance();
app.setTransparencyAttributes
(new TransparencyAttributes
(TransparencyAttributes.FASTEST,
1.0f));
前者の方が Primitive の個数が減ったときに Live なノードが減るため
速度の改善が期待できるが、ノードの追加削減は時間かかりそう。
パフォーマンステストしてみよう。