Recent

Author Topic: Circle Fractal: Many Cool Additions Added by Josh  (Read 4938 times)

Boleeman

  • Hero Member
  • *****
  • Posts: 722
Circle Fractal: Many Cool Additions Added by Josh
« on: February 25, 2024, 01:35:25 pm »
Go to the 2nd page to get to play around with the Phong Version.

The Lazarus beginning of a circle fractal program.

Converted from my VB6 code at https://github.com/BoleeMan/Circle-Fractal

Lazarus version not as colorful as the vb6 version yet.

Here is what I have so far:





« Last Edit: February 29, 2024, 06:39:22 am by Boleeman »

VisualLab

  • Hero Member
  • *****
  • Posts: 575
Re: Circle Fractal: Beginnings, with more to add.
« Reply #1 on: February 25, 2024, 03:13:18 pm »
The Lazarus beginning of a circle fractal program.

Converted from my VB6 code at https://github.com/BoleeMan/Circle-Fractal

Lazarus version not as colorful as the vb6 version yet. Also don't know why it is not showing on form create.

Here is what I have so far:

Very nice patterns.

Josh

  • Hero Member
  • *****
  • Posts: 1344
Re: Circle Fractal: Beginnings, with more to add.
« Reply #2 on: February 25, 2024, 03:23:28 pm »
add a bgrabitmap buffer image,convert to bgracanvas, and a few color changes and you get
The best way to get accurate information on the forum is to post something wrong and wait for corrections.

Dzandaa

  • Sr. Member
  • ****
  • Posts: 391
  • From C# to Lazarus
Re: Circle Fractal: Beginnings, with more to add.
« Reply #3 on: February 25, 2024, 04:08:13 pm »
Hi,
I did a quick Code based on yours:

B->
Regards,
Dzandaa

Boleeman

  • Hero Member
  • *****
  • Posts: 722
Re: Circle Fractal: Beginnings, with more to add.
« Reply #4 on: February 26, 2024, 02:55:58 am »
Dzandaa, I like the way yours resizes nicely. Very slick. BTW, why is the memo there?

To alter the number of circles to eight circles, we need to adjust this (so loop to 8 and make Pi/4 of which the divisor is half of eight   )

    DrawPanel.Canvas.Ellipse(X - R, Y - R, X + R, Y + R);
    for int1 := 1 to 8 do
      DrawCircle(Round(X + 2 * R * Cos((int1 - 1) * Pi / 4)),
                 Round(Y + 2 * R * Sin((int1 - 1) * Pi / 4)),
                 Round(R / 4.2), n - 1, k);

So to alter the number of circles with a TSpinedit and adjust the distance of the circles from the center with TTrackbar:

Code: Pascal  [Select][+][-]
  1.    for int1 := 1 to se_NumCircles.value do
  2.  
  3.     RecursiveCircle(Round(X + (TrackBar1.Position / 100) * R * Cos((int1 - 1) * Pi / (0.5*se_NumCircles.value))),
  4.                     Round(Y + (TrackBar1.Position / 100) * R * Sin((int1 - 1) * Pi / (0.5*se_NumCircles.value))),
  5.                     Round(R / 4.2), n - 1, k);  

Josh, what I was aiming for was with another pattern in the center, as shown below.

So I was thinking:

How do I isolate just one of the intricate patterns, copy it to a temp buffer, resize it slightly and paste it transparently to the center?

 Or

Just include another in the center by altering the algorithm?
« Last Edit: February 26, 2024, 08:00:04 am by Boleeman »

Roland57

  • Sr. Member
  • ****
  • Posts: 475
    • msegui.net
Re: Circle Fractal: Beginnings, with more to add.
« Reply #5 on: February 26, 2024, 06:59:00 am »
Here is what I have so far:

Here (on Linux) the window stays empty. Nothing is drawn.  :(

By the way, you don't need to write Form1. in TForm1 methods.
My projects are on Gitlab and on Codeberg.

Boleeman

  • Hero Member
  • *****
  • Posts: 722
Re: Circle Fractal: Beginnings, with more to add.
« Reply #6 on: February 26, 2024, 08:11:02 am »
My newest one with the the TTrackbar and TSpinedit and some TCheckboxes on a TImage.

First first picture:
Trackbar set to 180, TSpinedit for Recursion level = 4 and TSpinedit for Number of circles set to 8 circles.

For second picture:
7 circles and unfilled.

Roland I had for i := 1 to 8 do     instead of for int1 := 1 to 8 do

Also perhaps try Dzandaa's version, as he may have made that on Linux?
« Last Edit: February 26, 2024, 08:16:57 am by Boleeman »

Dzandaa

  • Sr. Member
  • ****
  • Posts: 391
  • From C# to Lazarus
Re: Circle Fractal: Beginnings, with more to add.
« Reply #7 on: February 26, 2024, 10:55:23 am »
Hi,

@Boleeman
Concerning the memo:
In you first version, I had the same problem as you with the display in Form.OnCreate.
So I quickly rewrote it using one of my Templates that had a memo for Logs and I forgot to remove it. That's it:)

B->
Regards,
Dzandaa

Roland57

  • Sr. Member
  • ****
  • Posts: 475
    • msegui.net
Re: Circle Fractal: Beginnings, with more to add.
« Reply #8 on: February 26, 2024, 02:00:37 pm »
Also perhaps try Dzandaa's version, as he may have made that on Linux?

Yes, that version works.
My projects are on Gitlab and on Codeberg.

lainz

  • Hero Member
  • *****
  • Posts: 4611
  • Web, Desktop & Android developer
    • https://lainz.github.io/
Re: Circle Fractal: Beginnings, with more to add.
« Reply #9 on: February 26, 2024, 04:29:41 pm »
Check this website, you will become crazy when the ammount of drawings they have:
https://openprocessing.org/browse/#

Dzandaa

  • Sr. Member
  • ****
  • Posts: 391
  • From C# to Lazarus
Re: Circle Fractal: Beginnings, with more to add.
« Reply #10 on: February 26, 2024, 06:48:25 pm »
Hi
@lainz

Thank you.

I know Processing and I used it a long time ago to control Arduino's, but I didn't know that website.

Processing: https://processing.org/

Cool language to test graphic programs.

@Roland57
I write my Lazarus code on Windows 7 64bits Pro but also test it on Linux 64bits and sometimes Mac OS (and Windows 10, beuark!!!).

B->
« Last Edit: February 26, 2024, 06:51:37 pm by Dzandaa »
Regards,
Dzandaa

Josh

  • Hero Member
  • *****
  • Posts: 1344
Re: Circle Fractal: Beginnings, with more to add.
« Reply #11 on: February 27, 2024, 10:45:09 am »
some ideas
The best way to get accurate information on the forum is to post something wrong and wait for corrections.

Boleeman

  • Hero Member
  • *****
  • Posts: 722
Re: Circle Fractal: Beginnings, with more to add.
« Reply #12 on: February 27, 2024, 10:51:12 am »
Dzandaa resizeable panel version with variable number of circles, radial position change and colours selection.

Play around with the colours and slider position.

Sorry put wrong update.

Will check out your version Josh.

Boleeman

  • Hero Member
  • *****
  • Posts: 722
Re: Circle Fractal: Beginnings, with more to add.
« Reply #13 on: February 27, 2024, 11:16:02 am »
Josh your effects are amazing. Really like the colour scheme and the random modes.

The rotate feature  was also good to include, to adjust the fractal for different numbers of circles.

For some reason on my Windows 10 the screen does not refresh initially (see second attached picture), but clicking show drawing refreshes it. Also noticed the random mode has repeated colours for the fills of the circles in level 2 of the fractal.

What would be nice is some variable opacity so when the petals overlap there is a see through effect (like in the Pythagoras Tree in https://forum.lazarus.freepascal.org/index.php/topic,66256.15.html on the last page).

Love how you make all of those variations. Really cool, with that Wow Factor.

The first attached picture in my previous reply, also has some sort of pixelated border on the smallest circles. Not sure how to reproduce that feature, so that the border on the smallest circles is variegated/spikey. Is there a way to adjust the border type on an ellipse?


Also now noticed that you used cb_CheckListBox. That's interesting. Never thought of using that instead of normal checkboxes.

I wonder also if Phong shading could be implemented using bgraBmp to give a 3D effect to the fractal. Your sample has opened all sorts of possibilities.

Man I feel like Christmas has come early. Love playing around with this sort of stuff.
« Last Edit: February 27, 2024, 11:42:27 am by Boleeman »

Josh

  • Hero Member
  • *****
  • Posts: 1344
Re: Circle Fractal: Beginnings, with more to add.
« Reply #14 on: February 27, 2024, 02:47:09 pm »
Opacity slider added

changed the random color method
The best way to get accurate information on the forum is to post something wrong and wait for corrections.

 

TinyPortal © 2005-2018