-
How to loop a Sin wave within X frames, starting at frame N?
Ok so I have a slider that I want to apply a Math.sin() wave to.
I want the wave to start at Frame 350 and Loop at 275 frames (so the value at Frame 350 is the same at Frame 625)
It doesn’t matter if the slider value is 0 until frame 350, just as long as frame 350 and 625 are the same, because that span of frames is where I’ll have my loop. (I’d actually prefer if the sin wave started at frame 0 and went on forever)Actually, thinking about it now, as long as it loops for 275 frames, it doesn’t matter where it “starts” because by default, frame 350 and 625 will be the same value if it loops every 275 frames
so having variables like this would be nice:
loop = 275 // the amount of frames the sine wave takes to loop
waves = 3 // the number of times the sine wave loopsmaybe even an “offset” variable for the number of frames to offset the sin wave by?
I’ve been trying to read up on sine and cosine waves, but can’t seem to figure out how to change the duration of the loop
Any suggestions?
Thank you!