bringing back a dead post to save creating a new thread. again similar problem only i was working on a new 3d engine.

i've been working on it for a long time, but only noticed this problem due to the fps changing.

vars:

[code=delphi]
iMoveSpeed: Single = 1;
iFrameRate: Cardinal; //obviously the fps
[/code]

[code=delphi]
if (buffer[DIK_A] and $80) <> 0 then begin
Cam.x := Cam.x + cos(Cam.RotX + PI/2) * (iMoveSpeed / iFrameRate);
Cam.z := Cam.z + sin(Cam.RotX + PI/2) * (iMoveSpeed / iFrameRate);
end else if (buffer[DIK_D] and $80) <> 0 then begin
Cam.x := Cam.x + cos(Cam.RotX - PI/2) * (iMoveSpeed / iFrameRate);
Cam.z := Cam.z + sin(Cam.RotX - PI/2) * (iMoveSpeed / iFrameRate);
end;

if (buffer[DIK_W] and $80) <> 0 then begin
Cam.x := Cam.x + cos(Cam.RotX) * (iMoveSpeed / iFrameRate);
Cam.y := Cam.y - cos(Cam.RotY + PI/2) * (iMoveSpeed / iFrameRate);
Cam.z := Cam.z + sin(Cam.RotX) * (iMoveSpeed / iFrameRate);
end else if (buffer[DIK_S] and $80) <> 0 then begin
Cam.x := Cam.x - cos(Cam.RotX) * (iMoveSpeed / iFrameRate);
Cam.y := Cam.y + cos(Cam.RotY + PI/2) * (iMoveSpeed / iFrameRate);
Cam.z := Cam.z - sin(Cam.RotX) * (iMoveSpeed / iFrameRate);
end;
[/code]

this works for moving around, however depending on framerate, it goes faster or slower.. i cant figure out how to keep it steady, note i use queryperformance for my counter/fps calculation.

thanks in advance.

;MM;