Recent

Author Topic: Fractal Tree  (Read 5064 times)

lainz

  • Hero Member
  • *****
  • Posts: 4468
    • https://lainz.github.io/
Fractal Tree
« on: June 22, 2018, 12:49:57 am »
Hi, this is my first fractal tree I ever made, I'm very happy  :)

Source:
https://github.com/bgrabitmap/demo/blob/master/fractal_tree/umain.pas

Thanks to @circlular for BGRABitmap as always, and also thanks to Rosetta Code for the actual algorythm (that I tweaked just a bit).

Edit: Oh, I think I removed the actual fractal thing adding randomness  ::) (added advise in code: Use even values without randomness to get a 'real' fractal image)
« Last Edit: June 22, 2018, 01:17:24 am by lainz »

circular

  • Hero Member
  • *****
  • Posts: 4220
    • Personal webpage
Re: Fractal Tree
« Reply #1 on: June 26, 2018, 11:07:07 am »
Really beautiful  :)
Conscience is the debugger of the mind

Boleeman

  • Sr. Member
  • ****
  • Posts: 433
Re: Fractal Tree
« Reply #2 on: December 16, 2022, 12:51:09 pm »
Made a Symmetric Fractal Tree from Lainz code on GitHub.

but on my netbook with a smaller screen the picture is out of whack. When I make the canvas wider I almost see the whole tree.

This is what it looks like on my bigger laptop (correct view) and the OutAWhack Netbook one

I think the problem is scaling the canvas for different dpi/resolutions.

« Last Edit: December 16, 2022, 01:32:13 pm by Boleeman »

lainz

  • Hero Member
  • *****
  • Posts: 4468
    • https://lainz.github.io/
Re: Fractal Tree
« Reply #3 on: December 16, 2022, 03:38:40 pm »
Very good  :)

Boleeman

  • Sr. Member
  • ****
  • Posts: 433
Re: Fractal Tree
« Reply #4 on: December 17, 2022, 12:26:29 am »
Actually I was playing around with branch thicknesses between levels. Below are some samples along with source code (I deleted the icons from each folder to save on space).

I thought of making each branch sort of radial filled gradient lines to make them appear as though they were round. I also need to learn how to add spin/textboxes to vary the different values as well as use a listbox to save and load preset values and how to save to a png file. The more I play around with your initial source code the more excited I get.

My initial stumbling block was how to add BGRABitmap to Lazarus, but after doing some Googling I finally worked that out. I downloaded the source from https://github.com/bgrabitmap/demo and have been tinkering with it over a couple of days.
« Last Edit: December 17, 2022, 12:30:45 am by Boleeman »

lainz

  • Hero Member
  • *****
  • Posts: 4468
    • https://lainz.github.io/
Re: Fractal Tree
« Reply #5 on: December 17, 2022, 02:18:01 am »
Bgrabitmap is very addictive  :)

Boleeman

  • Sr. Member
  • ****
  • Posts: 433
Re: Fractal Tree
« Reply #6 on: December 17, 2022, 05:45:52 am »
Just a Fractal Blob that I made. Enjoy.


circular

  • Hero Member
  • *****
  • Posts: 4220
    • Personal webpage
Re: Fractal Tree
« Reply #7 on: December 17, 2022, 08:50:06 pm »
Cool. I had not thought of that. Tree in all directions makes blob.  :)
Conscience is the debugger of the mind

Fred vS

  • Hero Member
  • *****
  • Posts: 3168
    • StrumPract is the musicians best friend
Re: Fractal Tree
« Reply #8 on: December 17, 2022, 11:24:38 pm »
« Last Edit: December 17, 2022, 11:26:33 pm by Fred vS »
I use Lazarus 2.2.0 32/64 and FPC 3.2.2 32/64 on Debian 11 64 bit, Windows 10, Windows 7 32/64, Windows XP 32,  FreeBSD 64.
Widgetset: fpGUI, MSEgui, Win32, GTK2, Qt.

https://github.com/fredvs
https://gitlab.com/fredvs
https://codeberg.org/fredvs

Boleeman

  • Sr. Member
  • ****
  • Posts: 433
Re: Fractal Tree
« Reply #9 on: December 18, 2022, 06:25:45 am »
Nice to see the Fractal animations posted by Fred vS.

Would be nice to control the speed of the animations.

Also thought of making my Fractal Blob rotate slowly from right to left, to simulate the movement of a Tumble Weed (Like on those old American Cowboy desert scenes). I like Fractals.


Fred vS

  • Hero Member
  • *****
  • Posts: 3168
    • StrumPract is the musicians best friend
Re: Fractal Tree
« Reply #10 on: December 18, 2022, 03:50:54 pm »
Nice to see the Fractal animations posted by Fred vS.

Would be nice to control the speed of the animations.
:::

Thanks!

In the animation (not really fluent from screen-capture, as the "true" animation from the program), the speed and shape are defined by the spectrum and volume of the sound.
You may try it from the project StrumPract, in menu choose "Image Dancer".
https://github.com/fredvs/strumpract/releases
There are also other BGRABitmap animations like Turltle by Lainz and Atom and Spiral by Winni, the code is in imagedancer.pas.

Fre;D
« Last Edit: December 18, 2022, 04:03:27 pm by Fred vS »
I use Lazarus 2.2.0 32/64 and FPC 3.2.2 32/64 on Debian 11 64 bit, Windows 10, Windows 7 32/64, Windows XP 32,  FreeBSD 64.
Widgetset: fpGUI, MSEgui, Win32, GTK2, Qt.

https://github.com/fredvs
https://gitlab.com/fredvs
https://codeberg.org/fredvs

VTwin

  • Hero Member
  • *****
  • Posts: 1215
  • Former Turbo Pascal 3 user
Re: Fractal Tree
« Reply #11 on: December 18, 2022, 11:03:15 pm »
Very cool!

By coincidence, I have been writing a fractal program for fun. I was fascinated in the 1980's and just started a new project, because I am procrastinating from actual work.



“Talk is cheap. Show me the code.” -Linus Torvalds

Free Pascal Compiler 3.2.2
macOS 12.1: Lazarus 2.2.6 (64 bit Cocoa M1)
Ubuntu 18.04.3: Lazarus 2.2.6 (64 bit on VBox)
Windows 7 Pro SP1: Lazarus 2.2.6 (64 bit on VBox)

VTwin

  • Hero Member
  • *****
  • Posts: 1215
  • Former Turbo Pascal 3 user
Re: Fractal Tree
« Reply #12 on: December 18, 2022, 11:06:16 pm »
One more.
“Talk is cheap. Show me the code.” -Linus Torvalds

Free Pascal Compiler 3.2.2
macOS 12.1: Lazarus 2.2.6 (64 bit Cocoa M1)
Ubuntu 18.04.3: Lazarus 2.2.6 (64 bit on VBox)
Windows 7 Pro SP1: Lazarus 2.2.6 (64 bit on VBox)

VTwin

  • Hero Member
  • *****
  • Posts: 1215
  • Former Turbo Pascal 3 user
Re: Fractal Tree
« Reply #13 on: December 18, 2022, 11:22:00 pm »
Another... (the last I promise)
“Talk is cheap. Show me the code.” -Linus Torvalds

Free Pascal Compiler 3.2.2
macOS 12.1: Lazarus 2.2.6 (64 bit Cocoa M1)
Ubuntu 18.04.3: Lazarus 2.2.6 (64 bit on VBox)
Windows 7 Pro SP1: Lazarus 2.2.6 (64 bit on VBox)

Boleeman

  • Sr. Member
  • ****
  • Posts: 433
Re: Fractal Tree
« Reply #14 on: December 25, 2022, 09:33:05 am »
Merry Christmas to All Lazarus Forumn members.

I have uploaded the tree fractals code and exe's to my Github page (just in case someone wanted to play with them) at: https://github.com/BoleeMan/Lazarus-TreeFractals

I have also been playing around with PascalABC.Net (Free pascal program). It has a more watered down interface but can do some really cool stuff. I uploaded examples also on another Github page at https://github.com/BoleeMan/PascalABCProgz

Hopefully it will give people some ideas to do some similar things in Lazarus.

Here are some examples below:


 

TinyPortal © 2005-2018