The MASM Forum

General => The Workshop => Topic started by: NoCforMe on July 14, 2023, 04:19:40 AM

Title: Burning ship fractal program
Post by: NoCforMe on July 14, 2023, 04:19:40 AM
Here's a program I wrote several years ago that displays the "burning ship" fractal. It shows static images that you can zoom into and out of. It's quite a fractal, very spooky-looking with lots and lots of surprising detail in certain areas. Please play around with it if you like. Use File--> Create fractal... to display an image. I have a list of preset images, or you can play around with the parameters. Once an image is displayed you can right-click and use the popup menu to zoom in. Left-click to choose the position on which to center the zoom-in.

I wish it did more, like being able to interactively zoom and pan around. But since the images are so computational-intensive, this isn't easy to do. And when zooming in, I find the zoom-in "bottoms out" before too long; the problem here is that zooming in is accomplished by restricting the range of the image, and pretty soon the numbers get too small for the FPU to deal with them. Haven't figured out how to get around that.

I'll post the code if anyone's interested. It's pretty big and complicated, but as with all my stuff I'm certainly willing to share it.

There are some really good burning ship videos (https://www.youtube.com/watch?v=CD9yNFmb2FE) on YouTube to show the incredible complexity of deep zooms (https://www.youtube.com/watch?v=0SNXOKL-KPo).
Title: Re: Burning ship fractal program
Post by: NoCforMe on July 14, 2023, 04:44:58 AM
Here are the formulas that create this fractal. Pretty simple. Amazing that such complexity arises out of them; where does all that stuff come from?
Title: Re: Burning ship fractal program
Post by: zedd151 on July 14, 2023, 06:05:16 AM
Quote from: NoCforMe on July 14, 2023, 04:44:58 AM
Here are the formulas that create this fractal. Pretty simple. Amazing that such complexity arises out of them; where does all that stuff come from?
Benoit B. Mandelbrot.   https://nnart.org/history-of-fractals/#Benoit_B_Mandelbrot_Father_of_Fractals
Title: Re: Burning ship fractal program
Post by: jj2007 on July 14, 2023, 07:21:49 AM
Looks good, but why does bs.exe take almost half a minute to launch?

When I open it with Olly, it takes 20 seconds to load the DLLs etc; once ready, when I press F9 to run bs.exe, it shows the dialog immediately.

This is on Win7-64. In my XP VM, it comes up immediately. Very weird :rolleyes:
Title: Re: Burning ship fractal program
Post by: Mikl__ on July 14, 2023, 07:35:38 AM
Hi, NoCforMe!
(https://wasm.in/styles/smiles_s/good2.gif)
Title: Re: Burning ship fractal program
Post by: NoCforMe on July 14, 2023, 08:16:02 AM
Quote from: jj2007 on July 14, 2023, 07:21:49 AM
Looks good, but why does bs.exe take almost half a minute to launch?
I have no idea. I noticed the same thing. At first I though it was maybe Windows Defender frowning and wondering whether it should permit the program to run.

Windoze 7(64) Pro here.

Quote
When I open it with Olly, it takes 20 seconds to load the DLLs etc; once ready, when I press F9 to run bs.exe, it shows the dialog immediately.

This is on Win7-64. In my XP VM, it comes up immediately. Very weird :rolleyes:
Title: Re: Burning ship fractal program
Post by: NoCforMe on July 14, 2023, 08:16:44 AM
Quote from: Mikl__ on July 14, 2023, 07:35:38 AM
Hi, NoCforMe!
(https://wasm.in/styles/smiles_s/good2.gif)

Right back atcha! How's tricks with you? Did you try the fractal thing?
Title: Re: Burning ship fractal program
Post by: Greenhorn on July 15, 2023, 04:11:10 AM
Looks good  :thumbsup:
Title: Re: Burning ship fractal program
Post by: NoCforMe on July 15, 2023, 05:15:13 AM
Quote from: Greenhorn on July 15, 2023, 04:11:10 AM
Looks good  :thumbsup:

Thanks. Any suggestions? This was my first and only fractal program. I'd like to be able to dive deeper into the pattern.
Title: Re: Burning ship fractal program
Post by: six_L on July 16, 2023, 02:19:33 AM
Hi,NoCforMe
Looks good.  :thumbsup:
The Mandelbrot Fractals are amazing. There are so many variants.
Title: Re: Burning ship fractal program
Post by: NoCforMe on July 16, 2023, 05:27:59 AM
Ackshooly, the burning ship fractal isn't part of the Mandelbrot set, strictly speaking. At most it's a variant of that set.

Still, it's all very cool. So many strange images!
Title: Re: Burning ship fractal program
Post by: raymond on July 17, 2023, 03:25:01 AM
Hi,NoCforMe
Just had a look at it. Interesting. :eusa_clap:  Will explore it further.

While on the subject of the Mandelbrot set, I got interested in it many many many years ago and I attempted to write my own program. For the curious ones not yet aware of it, you may d/l it from the same area as my FPU tut, where I cover complex numbers, i.e.

http://www.ray.masmcode.com/complex.html

Enjoy

Just remembered that the "Help" file may not be usable unless you have an old version of Windows.  :undecided:  :undecided:  :undecided:  :undecided:
Title: Re: Burning ship fractal program
Post by: mineiro on July 17, 2023, 09:05:11 AM
Arthur C Clarke - Fractals: The Colours of Infinity (1995):
https://www.youtube.com/watch?v=DyeR19m8gGk
Also about fractal compression.

Title: Re: Burning ship fractal program
Post by: daydreamer on July 19, 2023, 08:27:31 PM
cool NoCforme :thumbsup:
@raymond ,when you still worked did you used complex math?
when I went to school as teenager as electronics engineer,we also got some training in AC electric engines and taught complex math for the phase shift and how to compensate it with add condensator
Title: Re: Burning ship fractal program
Post by: raymond on July 19, 2023, 11:45:29 PM
Quote from: daydreamer on July 19, 2023, 08:27:31 PM@raymond ,when you still worked did you used complex math?

NO. Complex maths were not covered in high school, neither in chemistry classes at university. Only became aware of complex math when I was introduced to fractals later in life. And, desk tops were barely coming onto the market when I retired in '88 (i.e. 35 years ago!!!!).
Title: Re: Burning ship fractal program
Post by: daydreamer on July 20, 2023, 01:49:18 AM
Quote from: raymond on July 19, 2023, 11:45:29 PMNO. Complex maths were not covered in high school, neither in chemistry classes at university. Only became aware of complex math when I was introduced to fractals later in life. And, desk tops were barely coming onto the market when I retired in '88 (i.e. 35 years ago!!!!).
I started to appreciate Fern plant and nature more after seen fractals and wondered if a human is a really complex fractal?

I also enjoyed these related strange attractors
https://masm32.com/board/index.php?topic=9402.0 (https://masm32.com/board/index.php?topic=9402.0)
Title: Re: Burning ship fractal program
Post by: NoCforMe on July 20, 2023, 09:42:32 AM
Well, speaking as the author of that fractal program (Burning Ship), I can confidently say that no complex math at all went into that code. At least nothing explicitly complex (meaning anything having to do with √-1).

Here are the iterative formulae I used: you'll note nothing complex in them.
Title: Re: Burning ship fractal program
Post by: daydreamer on July 21, 2023, 10:43:49 PM
Quote from: NoCforMe on July 20, 2023, 09:42:32 AMWell, speaking as the author of that fractal program (Burning Ship), I can confidently say that no complex math at all went into that code. At least nothing explicitly complex (meaning anything having to do with √-1).

Here are the iterative formulae I used: you'll note nothing complex in them.

great candidate for SIMD version :thumbsup:
Title: Re: Burning ship fractal program
Post by: NoCforMe on July 22, 2023, 04:02:58 AM
But it works fine with the FPU; why would I want to use SIMD?

And isn't SIMD lower precision than FPU (80-bit REALs)?
Title: Re: Burning ship fractal program
Post by: daydreamer on July 22, 2023, 02:30:02 PM
Quote from: NoCforMe on July 22, 2023, 04:02:58 AMBut it works fine with the FPU; why would I want to use SIMD?

And isn't SIMD lower precision than FPU (80-bit REALs)?
I dont know whats required precision for Screen resolution xmax= ca 2000 (word),ymax = ca 1500 (word) ?,repeated calculation 3 million times can be loss of precision

I have never tested gdi with SIMT ,each thread draws part of image using its own fpu and getdc


Title: Re: Burning ship fractal program
Post by: NoCforMe on July 22, 2023, 02:36:09 PM
But you didn't answer the question: is SIMD lower resolution (meaning # of bits) than FPU or not? (I actually don't know myself.)