someone have the sources of the C++ code?
Somewhere around the Russian forum I posted a link to.
Something like this, if I'm not mistaken:
Code:
void build_fractal( int deep, float scale )
{
int dx, dy;
long color;
float cx, cy, zx, zxt, zy;
cy = (height / 2) * scale;
for( dy = height - 1; dy >= 0; dy-- ) {
cy = cy - scale;
cx = (width / 2) * scale;
for( dx = width - 1; dx >= 0; dx-- ) {
color = 0;
// Calculate color
cx = cx - scale;
zx = cx;
zy = cy;
while( zx * zx + zy * zy < 4 ) {
zxt = zx * zx - zy * zy + cx;
zy = 2 * zx * zy + cy;
zx = zxt;
color++;
if( color > deep ) break;
}
pix[ dy ][ dx ] = 4 * color;
}
}
}
Bookmarks