I don't see why not.  I am currently doing something similar in my
application, except I use imported objects and I construct the bg upon
importing them.  So in my actionPerformed(ActionEvent) I just need to add
it.  But creating the bg and then add it should be no different.
Paraskevas

--- Shamim Khaliq <[EMAIL PROTECTED]> wrote:
> can you do this  (create a branch group, add it to the live one) in an
> actionPerformed(ActionEvent) method?
>
> Shamim Khaliq  [EMAIL PROTECTED] <http://www.shamimkhaliq.co.uk/>
> ----- Original Message -----
> From: John Wright <[EMAIL PROTECTED]>
> To: <[EMAIL PROTECTED]>
> Sent: Tuesday, April 10, 2001 12:12 AM
> Subject: Re: [JAVA3D] Creating shapes at runtime???
>
>
> > Danny,
> >
> > To add a sphere to the live scene.  Create a BranchGroup, add your
> > transform group, add your sphere and then add this BG to the live BG
> > (root BG).
> >
> > rootBG (live)
> >   |
> > addBG (not live until added)
> >   |
> >  TG
> >   |
> > sphere
> >
> > - John Wright
> >
> > Danny Kahn wrote:
> > >
> > > I was wondering if anyone could clarify the explanation below on
> adding
> and
> > > removing shapes to a compiled or live BranchGroup.  As far as I can
> tell
> > > only the BranchGroup class has an ALLOW_DETACH capability bit, so how
> do
> > > you set it for the node that you want to add in?  Does this mean that
> you
> > > can only add in another BranchGroup node?  All I really want to do is
> to
> > > add in a sphere to the main content BranchGroup when the user clicks
> on
> > > certain locations on the screen.  This actually requires adding a new
> > > TransformGroup for each sphere.  So is it possible to create a new
> > > TransformGroup at runtime when a click has been received and then add
> it
> as
> > > a child to a live BranhcGroup?  Thanks for your help.
> > >
> > > Danny
> > >
> > > >Set the capability bit ALLOW_CHILDREN_EXPAND on the branchgroup, and
> set
> > > >the ALLOW_DETACH capability bit of the item to be added if you want
> to
> > > >remove it.  Then you should be able to add and remove even if the
> scene
> is
> > > >live or compiled.
> > > > >
> > > >
> > > >Good luck,
> > > >
> > > >Nathan Goff
> > > >
> > >
> > >
>
===========================================================================
> > > 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".
> >
>
>
===========================================================================
> 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".


__________________________________________________
Do You Yahoo!?
Get email at your own domain with Yahoo! Mail.
http://personal.mail.yahoo.com/

===========================================================================
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