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
70
G
17
Posts: 1,772
Reputation: 20,384

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
89
S
30
G
95
Posts: 5,159
Reputation: 63,454

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
384
S
227
G
86
Posts: 24,139
Reputation: 190,761


Return to Closed bugs

Who is online

Users browsing this forum: No registered users and 1 guest