Alessandro has correctly pointed out the Windows granularity of System.CurrentTimeMillis. J3DTimer does have some granularity but I've found it to be very good and capable of usage for smooth animation. (I don't have my figures handy for when I checked what it was - certainly it is MUCH better than 50ms on Win98 - that is the System.CurrentTimeMillis granularity NOT J3DTimer)
- John Wright Starfire Research Alessandro Borges wrote: > > Well, > I will report just what I've did and found. And it may or may not work for > you. > I am using Win2k/1.3GHz/512Mb/Java3D DirectX and both Gears run smoothly > here. > I also run on Win98/1.1GHz/384Mb/Java3D DirectX & OpenGL run AlphaGT > smoothly and original Alpha was terrible. > > Some days ago I did measures about System.CurrentTimeMilles granulty under > Windows and I got these numbers: > Win98 - 50ms (no good for animations) > Win2K - 10ms (good for animations, up to 100FPS) > WinXP - 10ms (good for animations, up to 100FPS) > > I did not measure J3DTimer granulity (I have to test it both Direct3D and > OpenGL). > But unless I am running more than 100 frames per second, on a Win2K, the > above granulity is enough. > I am using Vsync both OpenGL and DirectX, and refresh rate at 75Hz, and > this limited my full screen applications up to 75FPS, just enough for > animations I am working, when in Win2K. > I prefer J3DTimer becouse it works better in all workstations I've tested, > but seens it works not so fine for everyone... > Last tip : use fraps (www.fraps.com) to get your FPS. You will need a timer > with precision at least of 1000/FPS, in ms. > > If find a way to have a timer better the J3DTimer and > System.currentTimeMillis please share it ;-) > > Alessandro > > ----- Original Message ----- > From: "Smith, David" <[EMAIL PROTECTED]> > To: <[EMAIL PROTECTED]> > Sent: Friday, June 13, 2003 9:37 AM > Subject: Re: [JAVA3D] Animation Tips? > > Thanks for the heads up. > > I brought up your link on my Win2K/1.5Ghz/512MB here and > the GearBox original is actually smoother than the AlphaGT. > > Curious, it looks as if Win2k has 10ms granularity where as > Win98 is 50ms(I think I read that earlier). I presume this > is why I read somewhere, that someone had performed JNI to > call QueryPerformanceCounter on Windows. That way you could > just use that for all windows installations. > > Based on Vladimir's comment, I'm assuming that maybe WinXP > has a 7ms granularity. > > So I guess my problem is coming up with a solution that > takes varying time increments into account. Make sure that > we update to the right position(time). On machines with large > granularity(>10ms), it will be choppy, as opposed to smoother > with small time steps(<10ms). > > -DaveS > > > -----Original Message----- > > From: Alessandro Borges [mailto:[EMAIL PROTECTED] > > Sent: Friday, June 13, 2003 8:15 AM > > To: [EMAIL PROTECTED] > > Subject: Re: [JAVA3D] Animation Tips? > > > > > > I am using a animation behavior which works this way > > > > take initial time value from J3DTimer before start the animation > > at each elapsed frame > > { > > calculate the delta time (current - initial time); > > do the animation with that delta time value > > (optionally you can multiply delta time by a factor for > > slowmotion or fast > > motion porpuse) > > } > > > > > > This allows very smooth animation under Win98. > > You can also extend Alpha class, and force it to use J3DTimer instead > > System.currentTimeMillis. > > I did it for this demo : > > http://www.cpm2002.hpg.ig.com.br/alessandro/gearbox/AlphaGTDemo.html > > source code available there. > > > > Another and more complex solution is create your own Timer > > class based on > > J3DTimer, as well a Alpha extension to use it. So you can > > reset, pause, go > > fast or slower as you wish. > > > > Alessandro > > > > > > > > > > ----- Original Message ----- > > From: "Vladimir Vernikovski" <[EMAIL PROTECTED]> > > To: <[EMAIL PROTECTED]> > > Sent: Friday, June 13, 2003 6:05 AM > > Subject: Re: [JAVA3D] Animation Tips? > > > > > > > 1. Unfortunately, I havn't right timemer for the still... > > And we have in > > > WinXP timer with mistake 5 ms and this not good for animation :( > > > 2. I'm using J3D Behavior framework, mixed mode but it > > needs for some > > > modification. > > > > > > If you are interested for results (best run in NVidia > > Geforce and later > > > cards): > > > http://homepages.nsys.by:8101/~yvgtest/NewHouse/WebStart/ > > > > > > Vladimir A. Vernikovski > > > Programmer > > > ------------------------------------------- > > > JPROOF Technologies Ltd. > > > ----- Original Message ----- > > > From: "Smith, David" <[EMAIL PROTECTED]> > > > To: <[EMAIL PROTECTED]> > > > Sent: Thursday, June 12, 2003 7:53 PM > > > Subject: [JAVA3D] Animation Tips? > > > > > > > > > > Does anyone have any tips or heads-up on developing > > > > your own animation system in Java3D? A couple requirements > > > > are the ability to animate at all levels, object, geometric, > > > > and geometry attributes. Also, I want to be able to > > > > control the playback rate/frame rate. > > > > > > > > I have browsed the archives and some of the issues > > > > seem to be : > > > > > > > > 1) Finding the right timer. System.currentTimeMillis is > > > > OS dependent. Others created JNI to the OS(Windows for example > > > > to call QueryPerformanceTimer()). Some were saying look at > > > > JMF, Timer. So is there a final verdict on what is the > > > > best cross-platform timer to use? > > > > > > > > 2) To use or not to use the J3D Behavior framework, or just > > > > do it yourself in Mixed/Immediate mode rendering. > > > > > > > > 3) <Insert your concerns & questions here> > > > > > > > > Thanks, > > > > -DaveS > > > > > > > > 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". > > > > ========================= > 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".
