huh, nobody answers?
hi, since nobody answer, i'll try, but i'm not very experienced either, so i hope what i say is right.
what you need:
- a
onComboChange(...) method
- a TG or BG with capabilities
ALLOW_CHILDREN_WRITE and
ALLOW_CHILDREN_EXTEND - the corresponding Cube & Cone nodes.
Then, simply (pseudo-code):
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19
| void init() { Group myRoot = new BranchGroup(); myRoot.setCapability(...);
myCube = makeCube(); myCone = makeCone(); }
void onComboChange(...) { myForm = (myCube or myCone)
if (currentForm == null) myRoot.insertChild(myForm, 0); else myRoot.setChild(myForm, 0);
currentForm = myForm; } |
hmm... should work. shouldn't it?