Let there be fractals!

Hardware Hacking, Programming and Game Solutions/Cheats
Post Reply
User avatar
robcfg
Posts: 1532
Joined: Sat Apr 04, 2009 10:16 pm
Location: Stockholm, Sweden
Contact:

Let there be fractals!

Post by robcfg »

Hello everyone!

A couple of days ago I remembered seeing a very simple basic code on the CPCWiki to render a Mandelbrot set, so I thought it would be nice to adapt it for the Dragon.

I haven't seen any fractal program for the Dragon, so I put myself into it, and managed to write a not too complicated basic program that renders both Mandelbrot and Julia sets, in several screen modes and palettes.

As right now, it will take way looong to create an image, I added menu options to save the image to tape or disk.

I'm particularly proud of the color dithering as it looks awesome on the screen!

I created a page in the wiki for the program with the program itself along nice screenshots on different modes. You can go to page by clicking here.

Of course, suggestions are welcome, and I hope you enjoy it!

Regards,
Rob
sixxie
Posts: 1348
Joined: Fri Jul 18, 2008 8:36 am
Location: Hertfordshire
Contact:

Re: Let there be fractals!

Post by sixxie »

Neat - the dithering really makes all the difference.
User avatar
tormod
Posts: 416
Joined: Sat Apr 27, 2013 12:06 pm
Location: Switzerland
Contact:

Re: Let there be fractals!

Post by tormod »

Just awesome! Love fractals! I remember firing up the Dragon (a few years after the "wild years") to let it draw a fractale fern. Maybe I still have that program on a cassette somewhere. Anyway it was a short BASIC program, and it tooks hours before there was much of a fern to see.
Sarah
Posts: 177
Joined: Wed Apr 13, 2011 3:36 pm
Contact:

Re: Let there be fractals!

Post by Sarah »

They're fab, well done!

I can remember a fractal listing or two appearing in Dragon User but yours are more impressive than any I've seen before on the Dragon.
User avatar
snarkhunter
Posts: 241
Joined: Fri Apr 03, 2009 7:16 pm
Location: France

Re: Let there be fractals!

Post by snarkhunter »

Quite nice already (rendering times excepted, of course).

Have you got any plans to implement the rendering of Markus-Lyapunov fractals now, then?!
:mrgreen:
User avatar
robcfg
Posts: 1532
Joined: Sat Apr 04, 2009 10:16 pm
Location: Stockholm, Sweden
Contact:

Re: Let there be fractals!

Post by robcfg »

Thank you all for the nice replies!

I was actually surprised too when I generated the first one with dithering. Now I'm converting the basic code to other machines just for fun, while I think a way to turn it into asm to generate the images in a decent amount of time.

And yes, just for laughs it would be nice to try to get the Markus-Lyapunov working on a Dragon. Much better on an emulator because we don't want our machines to go in flames :lol:
jedie
Posts: 655
Joined: Wed Aug 14, 2013 12:23 pm
Location: germany
Contact:

Re: Let there be fractals!

Post by jedie »

Seems that there is a error in line 1630... Patch:

Code: Select all

- 1630 SAVE N$,VM,VM+6144,VM
+ 1630 CSAVE N$,VM,VM+6144,VM
isn't it?


EDIT: btw. for better usage: Use INKEY$ for the choice questions...
IMHO change the COORDINATE input and let the user just press ENTER for the default's for a full fractal.
... too many ideas and too little time ... Related stuff written in Python:
Dragon 32 emulator / PyDC - Python Dragon 32 converter: https://github.com/jedie/DragonPy
DWLOAD server / Dragon-Lib and other stuff: https://github.com/6809
User avatar
robcfg
Posts: 1532
Joined: Sat Apr 04, 2009 10:16 pm
Location: Stockholm, Sweden
Contact:

Re: Let there be fractals!

Post by robcfg »

Nice suggestion, but I didn't want to make the code more complicated than already is ;)

By the way, the SAVE statement on line 1630 is not an error, it's for saving the image to disk rather than tape. If you have a disk controller attached, it will save the image to the file name you specify.
jedie
Posts: 655
Joined: Wed Aug 14, 2013 12:23 pm
Location: germany
Contact:

Re: Let there be fractals!

Post by jedie »

robcfg wrote:By the way, the SAVE statement on line 1630 is not an error, it's for saving the image to disk rather than tape. If you have a disk controller attached, it will save the image to the file name you specify.
Ah! I need to add DOS tokens in PyDC ;)
... too many ideas and too little time ... Related stuff written in Python:
Dragon 32 emulator / PyDC - Python Dragon 32 converter: https://github.com/jedie/DragonPy
DWLOAD server / Dragon-Lib and other stuff: https://github.com/6809
Post Reply