DeltaTime Jitter on angles? r92

Bugs will be moved here once resolved.

Post » Wed Jun 06, 2012 7:17 am

Example of angle jitter.html

I'm setting the sprites angle to = (sin(ang)*90 )*(dt*60)
with (ang being +1 every tick)

The angle is smooth, but when I add "*(dt*60)" at the end to make it work at any framerate, it goes insane.

Am I using DT wrong? Or is this a DT bug?


alspal2012-06-06 07:48:52
B
134
S
65
G
16
Posts: 1,765
Reputation: 19,188

Post » Wed Jun 06, 2012 5:48 pm

You're using dt wrong. Outside of the sin() is the magnitude of the rotation, that shouldn't change. To use dt instead of adding 1 every tick to "ang" add 60*dt.

Or just rework the formula to use time directly.
sin(time*60)*90
B
79
S
24
G
52
Posts: 4,723
Reputation: 39,709

Post » Wed Jun 06, 2012 6:37 pm

Closing as not a bug, @R0J0Hound's explanation is correct - use dt when modifying 'ang' (which is the moving thing), not in that formula.
Scirra Founder
B
357
S
214
G
72
Posts: 22,946
Reputation: 178,208


Return to Closed bugs

Who is online

Users browsing this forum: No registered users and 2 guests