Hey,
I have a method which calculates fractal points and displays them as an Image.
What i would like to know, is how to make the method so that the threads concurrently take it in turns to work out the points themselves in the set efficiently.
Heres the code for the mandelbrot method;
private void mandelbrot() { // calculate all points
int x, y;
float h, b, alt = 0.0f;
actionOn = false;
setCursor(c1);
//showStatus("Computing Mandelbrot-Set ...");
for (x = 0; x < x1; x++) {
for (y = 0; y < y1; y++) {
h = pickColIndex(xStart + xZoom * (double)x, yStart + yZoom * (double)y); // color value
if (h != alt) {
b = 1.0f - h * h; // brightnes
g1.setColor(Color.getHSBColor(h, 0.8f, b));
alt = h;
}
g1.drawLine(x, y, x + 1, y);
}
}
Thanks in advance!
Josh
PS: im new to the forums so hello!!!!