Page 1 of 2

Mandelbrot Fractal - that doesn't suck...

Posted: Fri Aug 05, 2011 5:29 pm
by Astusvis
It's easily customizable, and I've previously used very similar code to create an animation using multiple frames saved to image files. (Only to minimize subsequent loading times.)

My reference to "that doesn't suck" is because I was prompted to release this after seeing this: http://love2d.org/forums/viewtopic.php?f=5&t=3388
Which doesn't work very well at all...

Bugs/feature requests/optimizations are welcome, though don't say my code is horrible. It isn't.


EDIT: Ignore the screenshot function, I didn't mean to leave that in there but I CBA to re-upload because it's not worth it.

Re: Mandelbrot Fractal - that doesn't suck...

Posted: Fri Aug 05, 2011 5:32 pm
by GijsB
thanks ._.?

but my latest version of it(last page) worked anyway ._.
Edit :

umm, yours only makes the image, but with mine you could zoom in and all that jazz (with lotsa thanks to kraftman)

Re: Mandelbrot Fractal - that doesn't suck...

Posted: Fri Aug 05, 2011 5:41 pm
by Astusvis
1) y0, x0, y1, x1 are basically ymin, xmin, ymax, xmax (The things you use to zoom.)
2) Your code is SLOW.
3) The latest posted .love is just threaded, no zooming at all.

I'm not saying yours doesn't work, nor that it is a very good learning exercise. Mine is simply better.

Re: Mandelbrot Fractal - that doesn't suck...

Posted: Fri Aug 05, 2011 5:45 pm
by Robin
Astusvis wrote:I'm not saying yours doesn't work, nor that it is a very good learning exercise. Mine is simply better.
You do use globals where locals would be more appropriate, though.

Re: Mandelbrot Fractal - that doesn't suck...

Posted: Fri Aug 05, 2011 5:48 pm
by Astusvis
Oh, do I have to define a variable as local manually? God damn every other language!

Re: Mandelbrot Fractal - that doesn't suck...

Posted: Fri Aug 05, 2011 5:54 pm
by tentus
Cool! Out of curiousity, why is images a table? So far as I can tell, there is only ever one thing in it.

Also, you may want to draw one frame saying "Loading" before you generate your image.

Re: Mandelbrot Fractal - that doesn't suck...

Posted: Fri Aug 05, 2011 5:58 pm
by Astusvis
Gah, more forgetting to clean up code >.>
I'm going to work on threading next, so a loading screen can wait.

Re: Mandelbrot Fractal - that doesn't suck...

Posted: Fri Aug 05, 2011 8:16 pm
by Astusvis
Threading DONE!
New upload on OP.

Re: Mandelbrot Fractal - that doesn't suck...

Posted: Fri Aug 05, 2011 8:21 pm
by GijsB
WHY U NO EDIT INSTEAD DOUBLE-POST?!

just kiding ;)

Re: Mandelbrot Fractal - that doesn't suck...

Posted: Fri Aug 05, 2011 8:23 pm
by Astusvis
Because then it doesn't show up as a new post. So people don't think anything is new.