Should be able to do it by subclassing Canvas3D and overriding the
postSwap() method:

public class myCanvas extends Canvas3D
{
    public Object waitObject = new Object();

    public void postSwap()
    {
        waitObject.notifyAll();
    }

}

Then instead of Thread.yield() etc. just call myCanvas.waitObject.wait();

Hope it helps,
Ewan

----- Original Message -----
From: "Chris Ender" <[EMAIL PROTECTED]>
To: <[EMAIL PROTECTED]>
Sent: Wednesday, October 15, 2003 1:20 PM
Subject: [JAVA3D] heavy calculation between frames


> Hi Java 3D fans
>
> I do a simulation. The calculation takes about a second and the rendering
> about 0.5 to 10 seconds. that is how it is done in a Thread so far:
>
> in Thread.run():
>
> canvas.stopRenderer();
> heavyCalculation();
> canvas.startRenderer();
>
> //wait
> try {
>     Thread.yield();
>     Thread.sleep(500);
> } catch (InterruptedException ie) {
> }
>
> unfortunatly the canvas isn't updated when the rendering takes more than
500
> ms. I want to update the picture after every step in simulation.
> my question: is there any possibility to ask the canvas if it is ready
with
> rending? I need something like: repeat Thread.yield/sleep until
> canvas.finished. Is this possible?
>
> Thank you
>
> Chris Ender
>
>
===========================================================================
> 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