Hi,

the key to solving your problem is the definition of object you use. Only
branch groups can be
added to and removed from the scene graph after making it live. So you have
to build objects as
groups of transforms and shapes contained in branchgroups, and to add an
object to the scene you
have to add its root branchgroup to the scene root (or to the appropriate
parent branch group,
if you want to build a hierarchy).

When implementing the described scheme, remember to set the necessary
capabilities to the branch
group objects and scene root. The ALLOW_CHILDREN_READ, ALLOW_CHILDREN_WRITE,
ALLOW_CHILDREN_EXTEND
and ALLOW_DETACH flags will suffice to enable all operations described
above.

Now let me summarize this:

+ (Initialization)

+ Create a root branch group, universe and viewing system

+ Dont forget: Set the root branches ALLLOW_xxx flags

+ For an object, create a branchgroup without attaching it to anything

+ Dont forget: Set the object branches ALLLOW_xxx flags

+ For this object, attach as many transforms and shapes as you like

+ (Start the scene, its live time)

+ On user request, attach the branchgroup of the desired object to the
  root branch.

Of course, this is only the basic scheme. Some high-priority modifications:
Clone objects on user demand,
tune the ALLOW_xxx flags (my settings simply let you do everything to the
structure, thats not necessary in
most cases), ...

HTH

Wolfgang Kienreich



-----Urspr�ngliche Nachricht-----
Von: Discussion list for Java 3D API
[mailto:[EMAIL PROTECTED]]Im Auftrag von TF
Gesendet: Montag, 23. September 2002 19:43
An: [EMAIL PROTECTED]
Betreff: [JAVA3D] Adding Geometry or BranchGroups after scene has been
compiled


I've made a small j3d viewer and I want to add a feature where you can add
predefined objects to the viewer and see the changes to the scene as they
come. I would like to know if this is possible and if it is how it's done.
If there are any tutorials on this out there I'd appreciate a link or if
it's simple, some sort of description would be greatly appreciated. Thanks
in advance for any help anyone can provide me.

Eric

===========================================================================
To unsubscribe, send email to [EMAIL PROTECTED] and include in the body
of the message "signoff JAVA3D-INTEREST".  For general help, send email to
[EMAIL PROTECTED] and include in the body of the message "help".

===========================================================================
To unsubscribe, send email to [EMAIL PROTECTED] and include in the body
of the message "signoff JAVA3D-INTEREST".  For general help, send email to
[EMAIL PROTECTED] and include in the body of the message "help".

Reply via email to