Beta Mandelbrot Set Generator For Pandora


Julia is a cool addition, but I would love to be able to zoom in there too!

Left clicking goes back to the mandelbrot plus zoom.


So how about ...
left clicking zooms into julia
right clicking undo's the zoom in julia until max zoom when it undo's back to mandelbrot at zoom and you can zoom in again from there


btw. This is certainly not just for yourself. I love just wandering around mandel & julia.
 
Just a quick sad update, had to reinstall windows due to a crash, for some unknown reason, while Windows XP saves all the user folders when reinstalling without a format, it does not save the shared documents folder, it deletes it completely...

As a result, I have a pretty old version of the code and nothing else.
I have to admit it depressed me to think about re-doing the parts I worked so hard on, by I think having the Pandora in my hands sometime in April or May might give me the needed push...
May 21st is my Birthday!!! Pandora was supposed to be an early birthday gift last year, at least the date is going to be right... ;)
 
Sorry to hear about the crash .. bad news - I had thought it had gone very quiet.


It does highlight the need for religous, regular and rigorous back-ups!
 
OK, back in business, I dug up a relatively recent version of the code from my work laptop (I was using it on and off for dev work on the train/bus to work).
Did a little tweaking and a lot of learning...

Basic keys are the same:
Left-Click -> Zoom in
Right-Click -> Zoom out
Middle-Click -> Pan (center image around mouse position)
s -> saves a screenshot
c -> cycle color palette
r -> reset all

I changed some of the keys, removed all the different options of increasing and decreasing iterations, left only:
+ -> multiplies number of iterations by 2 (up to 50000)
- -> divides number of iterations by 2 (down to 100) - Thanks for the idea Lizard809! much simpler and gets the job done.

Added a nicer implementation of Julia set:
Press 'j' once, when the mouse moves over the Mandelbrot set, a small Julia set corresponding to the position of the mouse is drawn in the corner (notice the semi-transparent SDL magic!), Zoom-in, Zoom-out, pan, increase and decrease the number of iterations works on the Mandelbrot set, save - saves a screen capture (along with a cursor to see where you are on the Mandelbrot set).
Press 'j' once more, the small image disappears, when you left click anywhere on the Mandelbrot set, the entire window is replaced by a larger version of Julia for that location, you can now use the regular Zoom-in, Zoom-out, Pan, change number of iterations, save as on the Mandelbrot set on the Julia set.
Press 'j' for the third time, you go back to the same Mandelbrot set you started from.

Still to do:
Add the cool palette editor written by Lizard809.
Add the zoom-box functionality again.
etc...

As before, still only a win32 executable, sorry, haven't been able to get Grub to reinstall yet...
Oh, and one last good bit of news, finally uploaded all the code to an online repository for backup... ;)

Have fun!
 
Hello again,

Seem to have lost some following to the project, no worries, I am still having fun! :)
Here's an updated win32 executable which has a greatly improved drawing routine, it is similar to the box drawing recursive routine but it isn't recursive.
The drawing time dropped by an average of 3 times faster (depending on the zoom level and how much of the image is a single color).

I've also modified the event loop to use SDL_WaitEvent instead of SDL_PollEvent when I finally figured out why it was taking up 100% of a cpu core at idle... ;)

Oh, and I've added a WIP opening screen, to give it a more professional look... not sure if I hit the mark with my piss poor job of an opening screen, but I promise to work on it...

Enjoy...
 
Nice to see some progress made :) I was thinking a possible feature could be the ability to save your current coordinates, so if you found a cool section of the fractal, you could come back to it at a later time, perhaps a later version which had more rendering features. Just a thought, sorry I don't have the time right now to help with this, been pretty busy with school lately.
 
I like the idea, actually thought about it, do you know if BMP files have a reserved space in the header?
If so, I could probably get it to save the coordinates (and any relevant information) in the image and then allow to run the application with an image as a command line parameter and go from there...
Actually, even if it doesn't have a reserved spot at the start of the file I could probably save a .txt file along with the image file for that purpose...

What do you think?
 
I really don't know much about bmp file format, though it is probably possible. Even if it is though. I think a txt file would be a wiser choice, because it would make the information easily readable and editable from outside the program.
 
great news that you've found some source!

It's amusing the the splash screen is five hundred times the size of the exe ;)

Why not just plot the inital Mandel set and fade some text over it
 
Hadn't occurred to me that I was using a bmp which is huge... :( sorry about that...
I think I'll try to use a png first because I am working on a nicer version which is not a flat picture of the Mandelbrot set using Blender.

Do you know of an easy way to include the image file in the executable to make it a single file?
 
^ This is not possible in a cross-platform way. But if you want to stay on Windows, you can use embedded resources (Google it) and if you want to go cross-platform, you can use Qt which has a cross-platform resource system (QRC) built in.
 
Is there no way to just stick the image file at the end of the executable (a la copy a+b c) and access it from the code?
 
You can encode it (bin2c) to an array and include it in your project to be compiled then instead of opening a file, point the decode routine to the array
 
Thanks man, that's exactly what I was looking for!
Now if there was only a way to zip an array... ;)
Maybe I should just go with 8bit and reduce the size that way...
 
gp32rich said:
Doesn't PNG encode with compression?
Yes it does.
You can use the program "optipng" (Google it) to compress your PNG image *losslessly* (aka without compression artifacts of any kind). The PNG format event supports indexed colors (unbeknownst to most people) and "optipng" will automatically use an indexed format if your image has less than 255 colors. So "optipng" can easily make PNG into the ideal compressed image format.

Usage: "optipng -o7 mysplash.png" for max compression

An example of a PNG image with extreme compression: the Git logo
git-logo.png

...with a total size of 207 bytes
 
Last edited by a moderator:
So making the image a PNG (don't need external applications for that, almost all image manipulation programs support PNG these days) and then put it into the code as an array...
That could actually work! I just need to include a PNG reading function in my code, which should be easy enough to find as it is an open format.

Thanks!
 
Hello again!

Sorry to resurrect such an old thread, but it made more sense than opening a new one.
I finally got my (wish I could say Pandora here) cross compiler working!

Here's a first ever ARM build of my program.
The tar.gz contains two files, the binary and an opening screen (sorry for the size, I have yet to include png decompression in my program).

I need a volunteer to try it out on a Pandora, just unzip both to the same folder and double click the fractals executable.

Please let me know if it works, if not, any additional information would be helpful!

It should not write anything to the NAND, all screen captures are saved to the same folder the application is running from.

Oh one last note, it uses SDL, which I am assuming is pre-installed on all Pandoras, right?

Thank you!
 
It works perfectly. Draws the fractal and zooms in and out with the mouse buttons. I don't know if it can do more things. Goes pretty fast at 800MHz. :) This is the output:
Code:
$ ./fractals 
First draw:
time= 3831, maxiter= 100
Exited cleanly
 
Back
Top