We closed this forum 18 June 2010. It has served us well since 2005 as the ALPHA forum did before it from 2002 to 2005. New discussions are ongoing at the new URL http://forum.processing.org. You'll need to sign up and get a new user account. We're sorry about that inconvenience, but we think it's better in the long run. The content on this forum will remain online.
IndexDiscussionExhibition › Simple fractal
Page Index Toggle Pages: 1
Simple fractal (Read 2241 times)
Simple fractal
May 19th, 2009, 1:15pm
 
I recognized the pattern shown by BenHem's Asymptote fractal, but from another algorithm: multiplication.
Code:
int w=256,h=256;
int sc = 1;

void setup() {
size(w,h);
noLoop();
}

void mouseDragged() {
sc += mouseX - pmouseX;
if (sc < 1) sc = 1;
if (sc > 65535) sc = 0xffff;
redraw();
}

void draw() {
loadPixels();
for (int x=0; x<w; x++) {
for (int y=0; y<h; y++) {
pixels[y*w+x] = (x*y*sc) | 0xff000000; //Colorized
//pixels[y*w+x] = ((x*y*sc) & 0xff)| 0xff000000; //this will show only the blue channel
//pixels[y*w+x] = ((x*y*sc) & 0xff00)| 0xff000000; //green, and if you pan the mouse quickly you can see what look like standing waves...
}
}
updatePixels();
}
Re: Simple fractal
Reply #1 - May 21st, 2009, 11:08pm
 
Oh wow. Well done. I've been looking for some fractals using processing.
Re: Simple fractal
Reply #2 - May 27th, 2009, 8:27pm
 
Interesting -- where did you recognize that fractal from?  Does it have a name?
Re: Simple fractal
Reply #3 - May 27th, 2009, 9:48pm
 
Not sure if it has a name...
I stumbled across it while filling background with different patterns. Was looking through some of the cellular automata rules and figured I would try basic math.

Your asymptote fractal was the closest I had seen.
Re: Simple fractal
Reply #4 - May 28th, 2009, 11:40am
 
Yeah, it's the same thing, definitely...
link for those curious to compare:

http://benhem.com/games/afractal/

I really like the formation of the next-level-up (red) fractal yours forms if you continue dragging to the right...I don't have a clear understanding of how yours works -- I think the major (top left) asymptote happens because of the (x*y), but the minor ones  Something to do with the tiers of color jumps in the hex notation
Re: Simple fractal
Reply #5 - May 28th, 2009, 10:46pm
 
Yep, as the results from multiplying need more bits, they start crossing into the next color bytes.

range 0-255 (0xFF): blue only
0-65535 (0xFFFF): blue and green
0-16777215 (0xFFFFFF): RGB
0-4Gig (0xFFFFFFFF): ARGB
>? Overflow, starts over... at least on a computer screen Smiley
Page Index Toggle Pages: 1