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
146
S
73
G
20
Posts: 1,785
Reputation: 22,395

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
91
S
31
G
102
Posts: 5,232
Reputation: 67,250

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
387
S
230
G
87
Posts: 24,248
Reputation: 192,228


Return to Closed bugs

Who is online

Users browsing this forum: No registered users and 3 guests