Mandelbrot Fractal - that doesn't suck...

Showcase your libraries, tools and other projects that help your fellow love users.
User avatar
Astusvis
Prole
Posts: 33
Joined: Fri Aug 05, 2011 5:22 pm

Mandelbrot Fractal - that doesn't suck...

Post 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.
Attachments
Mandelbrot.zip
V2.0 - Added threading
(1014 Bytes) Downloaded 286 times
Last edited by Astusvis on Fri Aug 05, 2011 8:16 pm, edited 1 time in total.
User avatar
GijsB
Party member
Posts: 380
Joined: Wed Jul 20, 2011 10:19 pm
Location: Netherlands

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

Post 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)
User avatar
Astusvis
Prole
Posts: 33
Joined: Fri Aug 05, 2011 5:22 pm

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

Post 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.
User avatar
Robin
The Omniscient
Posts: 6506
Joined: Fri Feb 20, 2009 4:29 pm
Location: The Netherlands
Contact:

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

Post 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.
Help us help you: attach a .love.
User avatar
Astusvis
Prole
Posts: 33
Joined: Fri Aug 05, 2011 5:22 pm

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

Post by Astusvis »

Oh, do I have to define a variable as local manually? God damn every other language!
User avatar
tentus
Inner party member
Posts: 1060
Joined: Sun Oct 31, 2010 7:56 pm
Location: Appalachia
Contact:

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

Post 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.
Kurosuke needs beta testers
User avatar
Astusvis
Prole
Posts: 33
Joined: Fri Aug 05, 2011 5:22 pm

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

Post by Astusvis »

Gah, more forgetting to clean up code >.>
I'm going to work on threading next, so a loading screen can wait.
User avatar
Astusvis
Prole
Posts: 33
Joined: Fri Aug 05, 2011 5:22 pm

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

Post by Astusvis »

Threading DONE!
New upload on OP.
User avatar
GijsB
Party member
Posts: 380
Joined: Wed Jul 20, 2011 10:19 pm
Location: Netherlands

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

Post by GijsB »

WHY U NO EDIT INSTEAD DOUBLE-POST?!

just kiding ;)
User avatar
Astusvis
Prole
Posts: 33
Joined: Fri Aug 05, 2011 5:22 pm

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

Post by Astusvis »

Because then it doesn't show up as a new post. So people don't think anything is new.
Post Reply

Who is online

Users browsing this forum: No registered users and 2 guests