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
139
S
67
G
17
Posts: 1,769
Reputation: 20,074

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
85
S
27
G
79
Posts: 5,016
Reputation: 54,766

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
373
S
218
G
84
Posts: 23,500
Reputation: 186,282


Return to Closed bugs

Who is online

Users browsing this forum: No registered users and 2 guests