consine.c draws a 2D representation of two sine waves, one on X-axis, the other Y-axis:
float value = fabsf(sin(fx/5.0)+sin(fy/2.5)); value /= 2.0;
With a character ramp to render out a result as below:
I decided to play with it a bit:
float value = fabsf(sin(fx/2.5)+sin(fx/5.0)+sin(fy/2.5)+sin(fy/5.0));
I forgot to adjust the equalizer to , but still produced an interesting result.
You could even add a Z-axis for colors, also using sine function or whatever you fancy, slowly swinging in the range of Z, playing a colorful animation, but I will leave that to you to play with.
consine.c was written by flarn2006 on the Pi Day of 2013, under the CC BY-SA 3.0 license.
0 comments:
Post a Comment
Note: Only a member of this blog may post a comment.