skipping certain number of frames on a timeline

Posted by clamp on Stack Overflow See other posts from Stack Overflow or by clamp
Published on 2010-05-10T09:42:46Z Indexed on 2010/05/10 9:54 UTC
Read the original article Hit count: 187

Filed under:
|

hi, i have a mathematical problem which is a bit hard to describe, but i'll give it a try anyway.

in a timeline, i have a number of frames, of which i want to skip a certain number of frames, which should be evenly distributed along the timeline.

for example i have 10 frames and i want to skip 5, then the solution is easy: we skip every second frame. 10/5 = 2

if (frame%2 == 0)
    skip();

but what if the above division does result in a floating number?

for example in 44 frames i want to skip 15 times. how can i determine the 15 frames which should be skipped?

thanks!

© Stack Overflow or respective owner

Related posts about mathematics

Related posts about algorithm