> Hi
>
>  I have a problem with behaviors objects. I would like know as the
>application kill this objects.
>
>  I have used the RotationInterpolator object for animate a cube and I
>would like animate this cube in opposite direction when I click in the
>button.
>
>  A apply the other Alpha object to RotationInterpolator for it, but the
> cube starts it new motion in the other position (initial position) and
not
> in the position when I clicked the button.
>
>  A think that if I kill the behavior object the cube start the new
> animation at the correct position.
>
>  I wait yours e-mails.
>
>  []s
>
>  Haroldo

I guess this will work(the rotators ri1 and ri2 should both have a
reference to tg, but only should be created at the time they are needed.

// Programinit

RotationInterpolator ri1        // should be defined
TransformGroup tg               // should be defined

tg.setCapability(Group.ALLOW_CHILDREN_EXTEND);
tg.this.setCapability(BranchGroup.ALLOW_CHILDREN_WRITE);        // allows the add
of bg2 below

BranchGroup bg1 = new BranchGroup( );
b1.setCapability(BranchGroup.ALLOW_DETACH);
bg1.addChild(r1);
tg.addChild(bg1);

// after pressing button

TransformGroup tg               // created in the first part
BranchGroup bg1         // created in the first part
RotationInterpolator ri2        // should be defined

bg1.detach( );

BranchGroup b2 = new BranchGroup( );
b2.setCapability(BranchGroup.ALLOW_DETACH);     // only if it should be
detached too
b2.addChild(r2);
tg.addChild(bg2);

--
Joachim "Madsheep" Schoder

                     [EMAIL PROTECTED]
                  [EMAIL PROTECTED]

                 Never ever stop thinking.

Sent through GMX FreeMail - http://www.gmx.net

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