properly calculating the time step?

how do you properly update the physics engine? I've read the documentation on how its supposed to work, and this is what I came up with:

Code:
//Global Variables:
float timeStep = 1.0f / 60.0f;
int iterations = 10;
float tstep_counter=0.0f;
int tsteps_thisframe;

// This is called during my program's update routine:

// tick counts are in milliseconds, so 1000's...
tstep_counter += (float)tickCount - (float)lastTickCount;

// 16.66f is (1/60)*1000
tsteps_thisframe = (int)(tstep_counter/16.66f);
for(int i=0; i<tsteps_thisframe; i++)
{
   myWorld->Step(timeStep, iterations);
   tstep_counter-=16.66f;
}


at first this seemed to work really well. Now, however, i'm rendering much more geometry per frame, and the physics seem really choppy. The framerate still sticks at 60 fps though. How am I supposed to be updating?
I recommend reading this article: http://www.gaffer.org/game-physics/fix-your-timestep/
That's a great article! I just read it. I've used that accumulator technique for other scenarios, but I never thought about doing it for the physics engine. That should solve a lot of problems down the road. Thanks for pointing it out Erin!
On a similar point, I'm using Box2D using a method like the one described in the article and it works like a dream.
The only stumbling block is that because Box2D is so efficient (thanks Erin) I can get some insanely high frame rates, therefore it would be really nice to add in the final step in to allow for this. i.e. allow interpolation between physics frames.

Gut feeling is that because of the small time step (1/60 of a second) then you pretty much are assuming that the movement will be small, and therefore just interpolating between the new/old position and new/old angle should be enough. But I was wondering if things like collision would look odd (the object would essentially slide from the pre-collision position to the post-collision position without moving to the collision point. Not an issue when you update positions once, at the 1/60 time step as visually you end up 'filling in the gaps'.

Any thoughts ?
Interpolating on your end should be fine. I doubt anyone would notice. I know that some commercial games ship with no interpolation. They just redraw the last position.
Thanks for that.. I'll give it a go..

Original thread: https://box2d.org/forum/viewtopic.php?t=276