Sorry your browser is not supported!

You are using an outdated browser that does not support modern web technologies, in order to use this site please update to a new browser.

Browsers supported include Chrome, FireFox, Safari, Opera, Internet Explorer 10+ or Microsoft Edge.

Code Snippets / [DBP] - Pattern Generator

Author
Message
Rapidrory
14
Years of Service
User Offline
Joined: 21st Aug 2009
Location:
Posted: 11th Jul 2011 19:53
Ok, so this isn't a very complicated bit of code, but it is still pretty cool. It basically loops through every pixel on your screen and sets it to a different colour based on some random maths. You can get some pretty cool effects out of it. I've added some examples at the bottom of the code, but you can change it to pretty much anything. I used to use some of these as the background on my phone :L



There is no such thing as "Too Fast!"
Neuro Fuzzy
16
Years of Service
User Offline
Joined: 11th Jun 2007
Location:
Posted: 12th Jul 2011 23:32 Edited at: 13th Jul 2011 00:23
Ahah, that's a great idea. I love how the sin(x) swapping negative and positive completely changes the color scheme xD

[edit]
I couldn't resist writing a supersampled version to get rid of the jaggies:


change the last parameter of "calculateSuperSampled" to add more computation time, but get a nicer image. Keep in mind that this is a squared relationship. when sampling=0, the number of function calculations per pixel is 1. smapling=1, calculations=9, sampling=2, calculations=25, sampling=3, calculations=49, and in general, calculations=(sampling*2+1)^2

[edit]
-exp(sin(-y)*sin(-y)*100)*(1-sin(x)*sin(x))*20000

MORDDOOOOORRR!


Why does blue text appear every time you are near?

Login to post a reply

Server time is: 2024-03-28 10:41:13
Your offset time is: 2024-03-28 10:41:13