Hi,

> Could you send me a patched version of VRML97Player which write the
> number of frames /s ?

You just have to overclass the canvas3D created in VRML97Player.java
line 279 with the code :

 canvas = new Canvas3D(null){
  long frameCount = 0;
  double lastTime = System.currentTimeMillis ();
  public void postSwap () {
   frameCount++;
   if ( (System.currentTimeMillis () - lastTime) >= 1000d) {
       double interval = (System.currentTimeMillis () - lastTime)/1000d;

       double fps = frameCount / interval;
       System.out.print ("\rfps="+fps+" #f="+frameCount+"
#t="+interval+"     ");
       System.out.flush ();
       lastTime = System.currentTimeMillis ();
       frameCount = 0;
   }
   }
   };

you will have the average number of calls to postswap every second on
the same line (assuming that postswap is
called after each rendered frame)

cheers
renaud

Reply via email to