[ART]A few arts that I made with SDL/C++
I don't know much about maths, so I just typed random stuff until I get something almost decent.
I hope to learn to do generate different things, soon.
C++ code:
r = 0.5*avg(y, x)/y/x/sin(pi * avg((((cos(pi * (sin(pi * cos(pi * x)) * avg(avg(x, x), sin(pi * y)))) * avg(sin(pi * (sin(pi * y) * (y * x))), cos(pi * cos(pi * (y * y))))) / sin(pi * (sin(pi * (sin(pi * y) * sin(pi * y))) / cos(pi * ((y * y) * sin(pi / y)))))) * sin(pi * avg(cos(pi / avg(((y * x) * (x * x)), sin(pi * (y * x)))), sin(pi * avg(avg(sin(pi * x), avg(x, x)), sin(pi * avg(x, y))))))), cos(pi * cos(pi * avg(sin(pi * sin(pi * avg((x * x), (x * x)))), sin(pi * sin(pi * sin(pi * sin(pi * y)))))))));
g = sin(pi*x/cos(pi*y));
b = 0.7*(sin(pi*x*x)*cos(pi*y*y));
It just uses a couple of for loops and sets the color for x and y to the color(r or g or b) to that *180+180.
edit: btw the idea came from
http://nifty.stanford.edu/2009/stone-random-art/ . I think I might have did something wrong since the example they give doesn't make the same thing, and also doesn't make a value between -1 and 1. If someone knows the difference between what I did and what that assignment wanted you to do, please tell me
btw, here's my code
http://pastebin.com/cbmgRM1N
Last edited by isaac; Jan 16, 2012 at 05:22 AM.