Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- var siny = Math.sin(((x + time / 17) * 4 * Math.PI) / width);
- // convert to range 0 to 1
- siny = (siny + 2) / 4;
- siny = siny * height;
- var thickness = (Math.sin(time / 500) * 3 + 5);
- var dist = Math.min(Math.abs(y - siny) / thickness, 1);
- return Math.floor((1 - dist) * 255);
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement