You can set max FPS on Java3D by setting minimun frame cycle time, like below example :
[code]
// my maximun desired FPS
float targetFPS = 30.0f;
// calculate time
long cicleTime = (long)(1000.0f / targetFPS) ;
//apply it
canvas3D.getView().setMinimumFrameCycleTime(cicleTime);
[/code]
On Java2D this is more complex. You must calculate your sleep time in a way to complement it to fit in your frame cycle .
frameCycleTime = timeToRender + sleeptime;
Take care that WinXP has latency ~15ms, so don't trust blindly on System.currentTimeMilllis() and Thread.sleep(long) on values lower than 30.
Some projects change sleeptime time each 5 or 10 frames.
[Message sent by forum member 'zesharp' (zesharp)]
http://forums.java.net/jive/thread.jspa?messageID=279130---------------------------------------------------------------------
To unsubscribe, e-mail:
interest-unsubscribe@...
For additional commands, e-mail:
interest-help@...