If the Java timer doesn't have the resolution you need then you can call out to native
methods and access higher resolution timers.
Portability is compromised however. The Pentium has high resolution timers.
Presumably ( and perhaps this is an assumption ) Java
will make higher resolution timers available in the future?
There is an issue of basic performance of Java3D. On a higher end machine such as a
PIII 500 with a TNT video card I am getting 30
fps refresh for environments of 4096 polygons of largely screen obscuring texels with
zbuffering. On the new Dell laptops with the
ATI Rage LT with 8mb RAM I am getting about 10~12 fps for the same app which I think
is acceptable. On anything lower than that it
gets pretty bad. In this case I'm rendering a mountainous terrain in a way that might
be somewhat similar to what you are doing.
You can go with other API's however I don't know of any which are rigorous, supported
yet free. My strategy for raw performance is
simply to wait for improved versions. It's just a question of where you place your
bets - you may have immediate commerical
imperatives which demand specialized solutions. I've had too much frustration with
too many API's to want to fiddle around
personally. About the only other option I would try given the time would be raw
OpenGL and cooking up a custom if limited
scenegraph architecture.
The 'new' you cite is definately a bad idea ( as you mention ).
- Anselm Hook
-----Original Message-----
From: Joerg 'Herkules' Plewe <[EMAIL PROTECTED]>
To: [EMAIL PROTECTED] <[EMAIL PROTECTED]>
Date: Wednesday, September 01, 1999 11:00 PM
Subject: [JAVA3D] Realtime? Or a fast timer?
>Hi all!
>
>I'm quite a newbie in Java and Java3D. I'm trying to setup some realtime
>rendering environment (think of a flightsim) and I'm running into very basic
>problem right from the beginning.
>
>For a flightsim, you need to know times quite precisely. What I tried is
>java.util.Date.getTime(), which claims to be a millisecond timer. In fact,
>on my win98 machine it's a 60ms-timer (see code below).
>Obviously, 60ms is bad, and even worth, the loop runs only 70000 times in
>5s!
>
>How can I really measure a millisecond?
>
>Is it the 'new' in the loop throtteling down the code?
>
>How do I have to setup Java3D for a realtime, frame-synchronous rendering?
>
>Hopefully someone here will help me,
>
>- J
>
>
>BTW, I checked out thing with this code:
>
>import java.io.*;
>import java.util.*;
>
>public class DateTest
>{
> public DateTest ()
> {
> Date dt = new Date();
> long ms = dt.getTime();
> long EndMs = ms + 5000;
> long maxdiff = 0;
> long loopcount = 0;
> ms = dt.getTime();
> while( ms < EndMs )
> {
> long oldms = ms;
> dt = new Date();
> ms = dt.getTime();
> if( ms - oldms > maxdiff )
> {
> maxdiff = ms - oldms;
> }
> loopcount++;
> }
> System.out.print( "Ups! " );
> System.out.println( maxdiff );
> System.out.println( loopcount );
> }
>
> public static void main(String args[])
> {
> DateTest Test = new DateTest();
> }
>}
>
>
>Joerg 'Herkules' Plewe
>HARDCODE Development
>http://www.hardcode.de
>
>===========================================================================
>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".