Hm hate it when that happens. Anyway heres the solution I came to. I should
probably read my patterns book and if there isnt one for it patent one - it
must be a pretty common thing!

1/ dont use the behaviours initialize() method to do the work.

2/ create the behaviour, pass it a branchgroup node that it can attach its
objects onto, and insert it into your scene graph.

3/ create a variable in your behaviour "Boolean initialised = false", and
insert this into your processStimulus method:

 if (initialised == false) {
     wakeupOn (wakeup);
     return;
 }

That stops your behaviour running before you have properly initialised it
yourself.

4/ once the nodes above the behavior are attached to the scengraph, call
your OWN myInitialise() method, which does all the hard work you wanted to
do in initialise().

This way you will be able to see the updates in the scenegraph each time
something is attached rather than at the end of the default initialize()
methods running.

Please note initialise is my preferred spelling - not a mistake.

Kind regards,

Nathan


----- Original Message -----
From: "Nathan Bower" <[EMAIL PROTECTED]>
To: <[EMAIL PROTECTED]>
Sent: Sunday, January 19, 2003 3:26 AM
Subject: [JAVA3D] refresh screen from behavior


> Hi,
>
> Simple question really, and I suppose there is a simple answer.
>
> I have a behaviour that loads objects into the scenegraph. After each
object
> is attached I want the screen to update and show the changes before the
next
> object starts to load (takes 4 minutes to load all objects).
>
> Currently its just luck whether I get to see things being added in real
time
> or not.
>
> Thanks for any help,
>
> Nathan
>
>
===========================================================================
> 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