[vtkusers] Frame Rate and moving actors

list at kobenetz.de list at kobenetz.de
Wed Mar 28 04:33:22 EDT 2007


Hi,
I'm trying to create an application where an actor moves from A to B on
mouse-click. I want to combine this with a vtkRenderWindowInteractor, so I
can watch the actor move.

I've set up a timer using vtkRenderWindowInteractor::CreateTimer, which
triggers a function that calculates the new position of the actor and
calls the Render method to update the RenderWindow. So far, everythings
works fine.

My question is:

How can I set the maximum frame rate? I could calculate the actors
position 1000 times per second, but that doesn't make any sense to me.

Is there any mechanism that takes care of the frame rate already or do I
have to write some class from scratch to do that?

I wonder where the frame rate comes from. Look at the cone2 example:

...

  for (i = 0; i < 360; ++i)
    {
    // render the image
    renWin->Render();
    // rotate the active camera by one degree
    ren1->GetActiveCamera()->Azimuth( 1 );
    }

...

On my Windows PC this example runs with exactly 60 frames per second,
somethings obviously limits the frame Rate.

On my new Mac with Windows this runs much faster, apparently without limit
(approx 400 frames per second).

WHY?




More information about the vtkusers mailing list