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
152
S
75
G
21
Posts: 1,795
Reputation: 23,285

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
94
S
33
G
117
Posts: 5,388
Reputation: 75,337

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
402
S
238
G
89
Posts: 24,613
Reputation: 195,993


Return to Closed bugs

Who is online

Users browsing this forum: No registered users and 1 guest