Sine oscillation speed
Posted: Thu May 01, 2014 7:19 pm
I'm using the following code to create a wavy background effect of an image but the oscillation speed is too fast.
How do I modify this so I can control the speed of the oscillation? If the angle increment is too small then the effect becomes less and less visible (just an oscillating image) , if it's too big then the effect becomes really bad ; just oscillating too fast.
Code: Select all
Pi.d = 3.1415926535897931
Phase.d = 0;
Amplitude = 10;
Waves = 2;
Angle.d = 0;
;Displays each row of pixels in the image with an offset to create the effect
For Count = 0 To Rows
DisplaySprite(Sprites(Count),x + (Amplitude * Sin(Phase + Waves*Angle)),y + Count)
Angle + Pi/32
Next