Author Topic: A dozen new and original IFS fractals  (Read 4598 times)

0 Members and 1 Guest are viewing this topic.

Offline AndyA

  • Newbie
  • Posts: 73
    • View Profile
A dozen new and original IFS fractals
« on: February 20, 2021, 01:51:56 am »
I was playing with Apophysis (a fractal generator with design editing, which is what I've been using) and came up with these (all except Spiral Tunnel).

I made these so that they should fit on a 1366 x 768 screen. That's what I had for a few years. If it doesn't quite fit, just change the screen height to 750 or even 745, that should do the trick.

Three of these are just variations on the same theme, namely 'Pointy Star', 'Star Wings' and 'Fluffy Star'. Just small changes create quite different images.


This one I like because of the detail of nested self-similar spirals.
Braided Spirals
Code: QB64: [Select]
  1. 'Original IFS fractal by Andy Amaya
  2. 'Braided Spirals
  3. _TITLE "IFS Braided Spirals"
  4.  
  5. SCREEN _NEWIMAGE(1024, 755, 32)
  6.  
  7. scale! = 542.543
  8. offsetX% = 280
  9. offsetY% = 412
  10.  
  11. gradient% = 1
  12. IF gradient% = 1 THEN
  13.     red! = 160.0
  14.     grn! = 0.0
  15.     blu! = 0.0
  16.  
  17.     COLOR _RGB(red!, grn!, blu!)
  18.     FOR i = 0 TO 755 STEP 3
  19.         LINE (0, i)-(1023, i + 2), , BF
  20.         red! = red! - .4
  21.         COLOR _RGB(red!, grn!, blu!)
  22.     NEXT
  23.     CLS , _RGB32(80, 0, 0)
  24.  
  25. COLOR _RGB32(255, 255, 255, 60)
  26. FOR iter& = 0 TO 1500000
  27.         CASE 0 TO 0.84
  28.             nx! = -0.940076 * lastX! + 0.109322 * lastY! + 0.868750
  29.             ny! = -0.132901 * lastX! + -0.959883 * lastY! + -0.061005
  30.         CASE 0.8400001 TO 0.93
  31.             nx! = -0.200339 * lastX! + -0.070879 * lastY! + 0.082227
  32.             ny! = 0.119883 * lastX! + -0.250145 * lastY! + 0.019925
  33.         CASE ELSE
  34.             nx! = 0.059150 * lastX! + -0.264528 * lastY! + -0.375950
  35.             ny! = 0.197019 * lastX! + -0.015262 * lastY! + 0.178505
  36.     END SELECT
  37.     IF iter& > 20& THEN PSET (nx! * scale! + offsetX%, ny! * scale! + offsetY%)
  38.     lastX! = nx!
  39.     lastY! = ny!
  40.  

IFS Dande-Leaf
Code: QB64: [Select]
  1. 'Original IFS fractal by Andy Amaya
  2. 'Dande-Leaf
  3. _TITLE "IFS Dande-Leaf"
  4.  
  5. SCREEN _NEWIMAGE(1024, 755, 32)
  6. CLS , _RGB32(0, 0, 80)
  7.  
  8. scale! = 124.552
  9.  
  10. transpose = 1
  11. IF transpose = 0 THEN
  12.     'Plot in usual way
  13.     offsetX% = 445: offsetY% = 201
  14.     'flip the X and Y axis to turn the graphic 90 degrees
  15.     offsetX% = 301: offsetY% = 251
  16.  
  17. red! = 128.0
  18. grn! = 128.0
  19. blu! = 0.0
  20.  
  21. COLOR _RGB(red!, grn!, blu!)
  22. FOR i = 0 TO 755 STEP 3
  23.     LINE (0, i)-(1023, i + 2), , BF
  24.     red! = red! - 0.4
  25.     grn! = grn! - 0.4
  26.     COLOR _RGB(red!, grn!, blu!)
  27.  
  28. COLOR _RGB32(255, 255, 255, 48)
  29. FOR iter& = 0 TO 1000000
  30.         CASE 0 TO 0.67
  31.             nx! = -0.843080 * lastX! + 0.508739 * lastY! + 0.366725
  32.             ny! = 0.508739 * lastX! + 0.843080 * lastY! + 0.305420
  33.         CASE 0.6700001 TO 0.97
  34.             nx! = 0.626559 * lastX! + -0.250481 * lastY! + -0.212725
  35.             ny! = 0.294432 * lastX! + 0.482080 * lastY! + 0.090219
  36.         CASE ELSE
  37.             nx! = -0.052541 * lastX! + -0.028642 * lastY! + -0.041935
  38.             ny! = -0.125541 * lastX! + -0.110988 * lastY! + -0.679700
  39.     END SELECT
  40.     IF transpose = 0 THEN
  41.         IF iter& > 20& THEN PSET (nx! * scale! + offsetX%, ny! * scale! + offsetY%)
  42.     ELSE
  43.         IF iter& > 20& THEN PSET (ny! * scale! + offsetY%, nx! * scale! + offsetX%)
  44.     END IF
  45.     lastX! = nx!
  46.     lastY! = ny!

IFS Dry Leaves
Code: QB64: [Select]
  1. 'Original IFS fractal by Andy Amaya
  2. 'Dry Leaves
  3. _TITLE "IFS Dry Leaves"
  4.  
  5. SCREEN _NEWIMAGE(1024, 755, 32)
  6.  
  7. scale! = 324.140
  8. offsetX% = 570
  9. offsetY% = 297
  10.  
  11. gradient% = 1
  12. IF gradient% = 1 THEN
  13.     red! = 255.0
  14.     grn! = 255.0
  15.     blu! = 255.0
  16.     COLOR _RGB(red!, grn!, blu!)
  17.     FOR i = 0 TO 755 STEP 3
  18.         LINE (0, i)-(1023, i + 2), , BF
  19.         red! = red! - .9
  20.         grn! = grn! - .9
  21.         blu! = blu! - .8
  22.         COLOR _RGB(red!, grn!, blu!)
  23.     NEXT
  24.     CLS , _RGB32(112, 112, 128)
  25.  
  26. COLOR _RGB32(80, 48, 0, 60)
  27. FOR iter& = 0 TO 1500000
  28.         CASE 0 TO 0.44
  29.             nx! = -0.243869 * lastX! + -0.745420 * lastY! + -0.003990
  30.             ny! = -0.745420 * lastX! + 0.243869 * lastY! + 0.425844
  31.         CASE 0.4400001 TO 0.82
  32.             nx! = 0.398172 * lastX! + -0.533236 * lastY! + -0.111045
  33.             ny! = -0.564692 * lastX! + -0.362100 * lastY! + -0.200485
  34.         CASE ELSE
  35.             nx! = -0.139673 * lastX! + -0.110775 * lastY! + 0.406389
  36.             ny! = 0.178204 * lastX! + 0.157489 * lastY! + -0.319936
  37.     END SELECT
  38.     IF iter& > 20& THEN PSET (nx! * scale! + offsetX%, ny! * scale! + offsetY%)
  39.     lastX! = nx!
  40.     lastY! = ny!

IFS Fire Leaves
Code: QB64: [Select]
  1. 'Original IFS fractal by Andy Amaya
  2. 'Fire Leaves
  3. _TITLE "IFS Fire Leaves"
  4.  
  5. SCREEN _NEWIMAGE(1024, 755, 32)
  6.  
  7. scale! = 323.610
  8. offsetX% = 240
  9. offsetY% = 305
  10.  
  11. gradient% = 1
  12. IF gradient% = 1 THEN
  13.     red! = 0.0
  14.     grn! = 128.0
  15.     blu! = 0.0
  16.     COLOR _RGB(red!, grn!, blu!)
  17.     FOR i = 0 TO 755 STEP 3
  18.         LINE (0, i)-(1023, i + 2), , BF
  19.         'red! = red! - .4
  20.         grn! = grn! - .4
  21.         blu! = blu! + .4
  22.         COLOR _RGB(red!, grn!, blu!)
  23.     NEXT
  24.     CLS , _RGB32(0, 0, 64)
  25.  
  26. COLOR _RGB32(255, 96, 0, 60)
  27. FOR iter& = 0 TO 1500000
  28.         CASE 0 TO 0.55
  29.             nx! = 0.450145 * lastX! + -0.725674 * lastY! + 0.850926
  30.             ny! = -0.772767 * lastX! + -0.295871 * lastY! + 0.943063
  31.         CASE 0.550001 TO 0.98
  32.             nx! = -0.125597 * lastX! + -0.569436 * lastY! + 0.336491
  33.             ny! = -0.435385 * lastX! + 0.435182 * lastY! + 0.274180
  34.         CASE ELSE
  35.             nx! = -0.132432 * lastX! + -0.278862 * lastY! + -0.051857
  36.             ny! = 0.077123 * lastX! + 0.171443 * lastY! + 0.884371
  37.     END SELECT
  38.     IF iter& > 20& THEN PSET (nx! * scale! + offsetX%, ny! * scale! + offsetY%)
  39.     lastX! = nx!
  40.     lastY! = ny!

IFS Fluffy Star
Code: QB64: [Select]
  1. 'Original IFS fractal by Andy Amaya
  2. 'Fluffy Star
  3. _TITLE "IFS Fluffy Star"
  4.  
  5. SCREEN _NEWIMAGE(1024, 755, 32)
  6.  
  7. scale! = 324.349
  8. offsetX% = 504
  9. offsetY% = 401
  10.  
  11. gradient% = 1
  12. IF gradient% = 1 THEN
  13.     red! = 0.0
  14.     grn! = 0.0
  15.     blu! = 128.0
  16.     COLOR _RGB(red!, grn!, blu!)
  17.     FOR i = 0 TO 755 STEP 3
  18.         LINE (0, i)-(1023, i + 2), , BF
  19.         blu! = blu! - .4
  20.         COLOR _RGB(red!, grn!, blu!)
  21.     NEXT
  22.     CLS , _RGB32(0, 0, 64)
  23.  
  24. COLOR _RGB32(208, 208, 255, 48)
  25. FOR iter& = 0 TO 1500000
  26.         CASE 0 TO 0.782261
  27.             nx! = -0.816914 * lastX! + 0.561746 * lastY! + -0.003345
  28.             ny! = -0.561746 * lastX! + -0.816914 * lastY! + 0.002228
  29.         CASE ELSE
  30.             nx! = 0.282758 * lastX! + 0.390905 * lastY! + -0.636573
  31.             ny! = 0.010828 * lastX! + 0.310650 * lastY! + -0.176126
  32.     END SELECT
  33.     IF iter& > 20& THEN PSET (nx! * scale! + offsetX%, ny! * scale! + offsetY%)
  34.     lastX! = nx!
  35.     lastY! = ny!

IFS Lined Spiral
Code: QB64: [Select]
  1. 'Original IFS fractal by Andy Amaya
  2. 'Lined Spiral
  3. _TITLE "IFS Lined Spiral"
  4.  
  5. SCREEN _NEWIMAGE(1024, 755, 32)
  6.  
  7. scale! = 511.730
  8. offsetX% = 309
  9. offsetY% = 102
  10.  
  11. gradient% = 1
  12. IF gradient% = 1 THEN
  13.     red! = 128.0
  14.     grn! = 0.0
  15.     blu! = 0.0
  16.  
  17.     COLOR _RGB(red!, grn!, blu!)
  18.     FOR i = 0 TO 755 STEP 3
  19.         LINE (0, i)-(1023, i + 2), , BF
  20.         red! = red! - .44
  21.         blu! = blu! + .88
  22.         COLOR _RGB(red!, grn!, blu!)
  23.     NEXT
  24.     CLS , _RGB32(24, 16, 0)
  25. COLOR _RGB32(255, 255, 255, 60)
  26.  
  27. FOR iter& = 0 TO 1500000
  28.         CASE 0 TO 0.85
  29.             nx! = 0.831291 * lastX! + 0.404627 * lastY! + -0.054528
  30.             ny! = -0.404627 * lastX! + 0.831291 * lastY! + 0.327965
  31.         CASE 0.8500001 TO 0.99
  32.             nx! = 0.206141 * lastX! + 0.202595 * lastY! + -0.427254
  33.             ny! = -0.202595 * lastX! + 0.206141 * lastY! + 0.093335
  34.         CASE ELSE
  35.             nx! = -0.065637 * lastX! + -0.060614 * lastY! + 0.174141
  36.             ny! = 0.112378 * lastX! + 0.115166 * lastY! + -0.124196
  37.     END SELECT
  38.     IF iter& > 20& THEN PSET (nx! * scale! + offsetX%, ny! * scale! + offsetY%)
  39.     lastX! = nx!
  40.     lastY! = ny!

IFS Oak Leaves
Code: QB64: [Select]
  1. 'Original IFS fractal by Andy Amaya
  2. 'Oak Leaves
  3. _TITLE "IFS Oak Leaves"
  4.  
  5. SCREEN _NEWIMAGE(1024, 755, 32)
  6.  
  7. scale! = 324.140
  8. offsetX% = 570
  9. offsetY% = 297
  10.  
  11. gradient% = 1
  12. IF gradient% = 1 THEN
  13.     red! = 96.0
  14.     grn! = 0.0
  15.     blu! = 192.0
  16.     COLOR _RGB(red!, grn!, blu!)
  17.     FOR i = 0 TO 755 STEP 3
  18.         LINE (0, i)-(1023, i + 2), , BF
  19.         red! = red! - .4
  20.         blu! = blu! - .7
  21.         COLOR _RGB(red!, grn!, blu!)
  22.     NEXT
  23.     CLS , _RGB32(64, 0, 128)
  24.  
  25. COLOR _RGB32(64, 255, 32, 60)
  26. FOR iter& = 0 TO 1500000
  27.         CASE 0 TO 0.58
  28.             nx! = -0.243869 * lastX! + -0.745420 * lastY! + -0.003990
  29.             ny! = -0.745420 * lastX! + 0.243869 * lastY! + 0.425844
  30.         CASE 0.5800001 TO 0.99
  31.             nx! = 0.398172 * lastX! + -0.533236 * lastY! + -0.122126
  32.             ny! = -0.564692 * lastX! + -0.362100 * lastY! + -0.184116
  33.         CASE ELSE
  34.             nx! = -0.139673 * lastX! + -0.110775 * lastY! + 0.406389
  35.             ny! = 0.178204 * lastX! + 0.154489 * lastY! + -0.319936
  36.     END SELECT
  37.     IF iter& > 20& THEN PSET (nx! * scale! + offsetX%, ny! * scale! + offsetY%)
  38.     lastX! = nx!
  39.     lastY! = ny!

IFS Pinwheel
Code: QB64: [Select]
  1. 'Original IFS fractal by Andy Amaya
  2. 'Pinwheel
  3. _TITLE "IFS Pinwheel"
  4.  
  5. scale! = 253.200
  6. offsetX% = 385
  7. offsetY% = 428
  8. SCREEN _NEWIMAGE(1024, 755, 32)
  9. CLS , _RGB32(0, 0, 80)
  10.  
  11.  
  12. blu! = 255.0
  13. COLOR _RGB(0, 0, blu!)
  14.  
  15. FOR i = 0 TO 755 STEP 3
  16.     LINE (0, i)-(1023, i + 2), , BF
  17.     blu! = blu! - 0.85
  18.     COLOR _RGB(0, 0, blu!)
  19.  
  20. COLOR _RGB32(255, 255, 96, 48)
  21. FOR iter& = 0 TO 2000000
  22.         CASE 0 TO .8
  23.             nx! = 0.004855 * lastX! + -0.990169 * lastY! + 0.333507
  24.             ny! = 0.990169 * lastX! + 0.004855 * lastY! + -0.690207
  25.         CASE ELSE
  26.             nx! = 0.143532 * lastX! + 0.552904 * lastY! + -0.165432
  27.             ny! = -0.266752 * lastX! + 0.203483 * lastY! + 0.086279
  28.     END SELECT
  29.     IF iter& > 20& THEN PSET (nx! * scale! + offsetX%, ny! * scale! + offsetY%)
  30.     lastX! = nx!
  31.     lastY! = ny!

IFS Pointy Star
Code: QB64: [Select]
  1. 'Original IFS fractal by Andy Amaya
  2. 'Pointy Star
  3. _TITLE "IFS Pointy Star"
  4.  
  5. SCREEN _NEWIMAGE(1024, 755, 32)
  6.  
  7. scale! = 270.0
  8. offsetX% = 509
  9. offsetY% = 376
  10.  
  11. gradient% = 1
  12. IF gradient% = 1 THEN
  13.     red! = 0.0
  14.     grn! = 0.0
  15.     blu! = 128.0
  16.     COLOR _RGB(red!, grn!, blu!)
  17.     FOR i = 0 TO 755 STEP 3
  18.         LINE (0, i)-(1023, i + 2), , BF
  19.         blu! = blu! - .4
  20.         COLOR _RGB(red!, grn!, blu!)
  21.     NEXT
  22.     CLS , _RGB32(0, 0, 64)
  23.  
  24. COLOR _RGB32(208, 208, 255, 48)
  25. FOR iter& = 0 TO 1500000
  26.         CASE 0 TO 0.782261
  27.             nx! = -0.814831 * lastX! + 0.574685 * lastY! + -0.003345
  28.             ny! = -0.564763 * lastX! + -0.741019 * lastY! + 0.002228
  29.         CASE ELSE
  30.             nx! = 0.364791 * lastX! + 0.278183 * lastY! + -0.630902
  31.             ny! = 0.221807 * lastX! + 0.418540 * lastY! + -0.204482
  32.     END SELECT
  33.     IF iter& > 20& THEN PSET (nx! * scale! + offsetX%, ny! * scale! + offsetY%)
  34.     lastX! = nx!
  35.     lastY! = ny!

This one is an old one, but I'm a sucker for spiral variations.

IFS Spiral Tunnel   (generated by J.C. Sprott - IFS.bas)
Code: QB64: [Select]
  1. 'Original IFS fractal by Andy Amaya
  2. 'Spiral Tunnel
  3. _TITLE "IFS Spiral Tunnel"
  4.  
  5. scaleX! = 709.466
  6. scaleY! = 380.466
  7. offsetX% = 367
  8. offsetY% = 327
  9. SCREEN _NEWIMAGE(1024, 755, 32)
  10.  
  11. red! = 255.0
  12. grn! = 255.0
  13. blu! = 0.0
  14. COLOR _RGB(red!, grn!, blu!)
  15.  
  16. FOR i = 0 TO 755 STEP 3
  17.     LINE (0, i)-(1023, i + 2), , BF
  18.     red! = red! - 0.85
  19.     grn! = grn! - 0.95
  20.     COLOR _RGB(red!, grn!, blu!)
  21.  
  22. COLOR _RGB32(64, 0, 160, 48)
  23. FOR iter& = 0 TO 2000000
  24.         CASE 0 TO .833
  25.             nx! = -0.70 * lastX! + 0.30 * lastY! + 0.30
  26.             ny! = -0.90 * lastX! + -0.80 * lastY! + 0.50
  27.         CASE ELSE
  28.             nx! = -0.20 * lastX! + 0.30 * lastY! + -0.10
  29.             ny! = 0.90 * lastX! + -0.80 * lastY! + 0.00
  30.     END SELECT
  31.     IF iter& > 20& THEN PSET (nx! * scaleX! + offsetX%, ny! * scaleY! + offsetY%)
  32.     lastX! = nx!
  33.     lastY! = ny!

IFS Star Wings
Code: QB64: [Select]
  1. 'Original IFS fractal by Andy Amaya
  2. 'Star Wings
  3. _TITLE "IFS Star Wings"
  4.  
  5. SCREEN _NEWIMAGE(1024, 755, 32)
  6.  
  7. scale! = 324.349
  8. offsetX% = 504
  9. offsetY% = 401
  10.  
  11. gradient% = 1
  12. IF gradient% = 1 THEN
  13.     red! = 0.0
  14.     grn! = 0.0
  15.     blu! = 128.0
  16.     COLOR _RGB(red!, grn!, blu!)
  17.     FOR i = 0 TO 755 STEP 3
  18.         LINE (0, i)-(1023, i + 2), , BF
  19.         blu! = blu! - .4
  20.         COLOR _RGB(red!, grn!, blu!)
  21.     NEXT
  22.     CLS , _RGB32(0, 0, 64)
  23.  
  24. COLOR _RGB32(208, 208, 255, 48)
  25. FOR iter& = 0 TO 1500000
  26.         CASE 0 TO 0.782261
  27.             nx! = -0.816914 * lastX! + 0.561746 * lastY! + -0.003345
  28.             ny! = -0.561746 * lastX! + -0.816914 * lastY! + 0.002228
  29.         CASE ELSE
  30.             nx! = 0.282758 * lastX! + 0.390905 * lastY! + -0.636573
  31.             ny! = 0.010828 * lastX! + 0.310650 * lastY! + -0.176126
  32.     END SELECT
  33.     IF iter& > 20& THEN PSET (nx! * scale! + offsetX%, ny! * scale! + offsetY%)
  34.     lastX! = nx!
  35.     lastY! = ny!


This one reminded me of those creatures from the movie 'Tremors'.

IFS Tricera-Fract
Code: QB64: [Select]
  1. 'Original IFS fractal by Andy Amaya
  2. 'Tricera-Fract
  3. _TITLE "IFS Tricera-Fract"
  4.  
  5. SCREEN _NEWIMAGE(1024, 755, 32)
  6.  
  7. scale! = 264.736
  8. offsetX% = 630
  9. offsetY% = 425
  10.  
  11. gradient% = 1
  12. IF gradient% = 1 THEN
  13.     red! = 62.0
  14.     grn! = 31.0
  15.     blu! = 0.0
  16.  
  17.     COLOR _RGB(red!, grn!, blu!)
  18.     FOR i = 0 TO 755 STEP 3
  19.         LINE (0, i)-(1023, i + 2), , BF
  20.         red! = red! - .22
  21.         grn! = grn! - .12
  22.         COLOR _RGB(red!, grn!, blu!)
  23.     NEXT
  24.     CLS , _RGB32(24, 16, 0)
  25. COLOR _RGB32(255, 255, 180, 60)
  26.  
  27. FOR iter& = 0 TO 1500000
  28.         CASE 0 TO 0.62
  29.             nx! = -0.516076 * lastX! + -0.792133 * lastY! + -0.542779
  30.             ny! = 0.792133 * lastX! + -0.516076 * lastY! + 0.412808
  31.         CASE 0.6200001 TO 0.84
  32.             nx! = 0.294921 * lastX! + 0.240110 * lastY! + 0.493068
  33.             ny! = -0.032464 * lastX! + 0.345342 * lastY! + 0.808644
  34.         CASE ELSE
  35.             nx! = -0.170761 * lastX! + -0.276078 * lastY! + -0.229303
  36.             ny! = 0.265610 * lastX! + -0.179727 * lastY! + -0.375222
  37.     END SELECT
  38.     IF iter& > 20& THEN PSET (nx! * scale! + offsetX%, ny! * scale! + offsetY%)
  39.     lastX! = nx!
  40.     lastY! = ny!

Offline bplus

  • Global Moderator
  • Forum Resident
  • Posts: 8053
  • b = b + ...
    • View Profile
Re: A dozen new and original IFS fractals
« Reply #1 on: February 20, 2021, 02:12:57 am »
Very nice! I think you've been working on background colorings, fire leaf definitely struck me with color usage, and some of fractals look they are being rotated in 3D. Beautiful works of art all!

Oh also they are rendered almost immediately.

After Screen _NewImage....
_delay .25
_ScreenMove _middle ' to center
« Last Edit: February 20, 2021, 02:17:31 am by bplus »

Offline bplus

  • Global Moderator
  • Forum Resident
  • Posts: 8053
  • b = b + ...
    • View Profile
Re: A dozen new and original IFS fractals
« Reply #2 on: February 20, 2021, 02:24:21 am »
Reversed Green and Blue:
 
reversed green and blue.PNG


Code: QB64: [Select]
  1.  'Original IFS fractal by Andy Amaya
  2. 'Fire Leaves
  3. _TITLE "IFS Fire Leaves"
  4.  
  5. SCREEN _NEWIMAGE(1024, 755, 32)
  6. _DELAY .25
  7.  
  8.  
  9. scale! = 323.610
  10. offsetX% = 240
  11. offsetY% = 305
  12.  
  13. gradient% = 1
  14. IF gradient% = 1 THEN
  15.     red! = 0.0
  16.     grn! = 0
  17.     blu! = 128
  18.     COLOR _RGB(red!, grn!, blu!)
  19.     FOR i = 0 TO 755 STEP 3
  20.         LINE (0, i)-(1023, i + 2), , BF
  21.         'red! = red! - .4
  22.         grn! = grn! + .4
  23.         blu! = blu! - .4
  24.         COLOR _RGB(red!, grn!, blu!)
  25.     NEXT
  26.     CLS , _RGB32(0, 0, 64)
  27.  
  28. COLOR _RGB32(255, 96, 0, 60)
  29. FOR iter& = 0 TO 1500000
  30.         CASE 0 TO 0.55
  31.             nx! = 0.450145 * lastX! + -0.725674 * lastY! + 0.850926
  32.             ny! = -0.772767 * lastX! + -0.295871 * lastY! + 0.943063
  33.         CASE 0.550001 TO 0.98
  34.             nx! = -0.125597 * lastX! + -0.569436 * lastY! + 0.336491
  35.             ny! = -0.435385 * lastX! + 0.435182 * lastY! + 0.274180
  36.         CASE ELSE
  37.             nx! = -0.132432 * lastX! + -0.278862 * lastY! + -0.051857
  38.             ny! = 0.077123 * lastX! + 0.171443 * lastY! + 0.884371
  39.     END SELECT
  40.     IF iter& > 20& THEN PSET (nx! * scale! + offsetX%, ny! * scale! + offsetY%)
  41.     lastX! = nx!
  42.     lastY! = ny!
« Last Edit: February 20, 2021, 02:26:25 am by bplus »

Offline Dav

  • Forum Resident
  • Posts: 792
    • View Profile
Re: A dozen new and original IFS fractals
« Reply #3 on: February 20, 2021, 06:39:47 am »
These are absolutely beautiful.  Well deserving of obtaining a special folder in my qb64 directory.  Thanks for sharing!

- Dav

Offline bplus

  • Global Moderator
  • Forum Resident
  • Posts: 8053
  • b = b + ...
    • View Profile
Re: A dozen new and original IFS fractals
« Reply #4 on: February 20, 2021, 09:53:14 am »
I am looking at Fire Leaves again and thinking one can render a fire effect faster maybe if:

1. Don't start drawing the sticky parts until the level is reached they dont look like sticks,
2. Alter the color red with fire pallet or palette, oh color by recurs level the lower levels white and yellow really low a dash of blue!
3. Overlap several renderings
4. Point the first sticks up

maybe? well maybe for a still shot.
« Last Edit: February 20, 2021, 09:55:20 am by bplus »

Offline bplus

  • Global Moderator
  • Forum Resident
  • Posts: 8053
  • b = b + ...
    • View Profile
Re: A dozen new and original IFS fractals
« Reply #5 on: February 20, 2021, 09:59:50 am »
Oh! To see the Beast run this in Roto and rotate 40 degrees +/-

 
To see the beast.PNG



The Beast has a Vortex for mouth and nose that sucks in star systems or you! like a vacuum cleaner, it is most anti-anti-gravity.


Oh heck run this in rotozoom with cls by fades.
« Last Edit: February 20, 2021, 10:07:28 am by bplus »

Offline AndyA

  • Newbie
  • Posts: 73
    • View Profile
Re: A dozen new and original IFS fractals
« Reply #6 on: February 20, 2021, 11:34:14 am »
Thanks for the kind words.

@Dav
I did some other IFS fractals on this post: https://www.qb64.org/forum/index.php?topic=1965.0

Ashish has also done some IFS fractals and L-System fractals.

Someone else did some fractals converted from 'Ultra Fractal' or something similar.

Just goes to show what can be done mathematically to draw images.


@bplus
I like the reversal of the background in 'Fire Leaves' that you did, it somehow looks better, even though the color palette is the same.

As for 'Fire Leaves' (and all the others for that matter), the image is drawn one point at a random location in the 'orbit' of the 'attractor'. This boils down to, there's no way to procedurally draw anything, it's always going to be a single point drawn at a random location in the image.

Offline bplus

  • Global Moderator
  • Forum Resident
  • Posts: 8053
  • b = b + ...
    • View Profile
Re: A dozen new and original IFS fractals
« Reply #7 on: February 20, 2021, 11:48:35 am »
Quote
This boils down to, there's no way to procedurally draw anything, it's always going to be a single point drawn at a random location in the image.

I managed to draw the classic fern and your pine tree any where on screen with different palettes, did you see Christmas 2020? ;-))

Reply #17 Christmas 2020 Thread
https://www.qb64.org/forum/index.php?topic=3332.msg126398#msg126398

These snippets have a center x, y they are drawn albeit randomly but you can rubber stamp process and alter colors and scales... even sway the ferns in the wind!
Code: QB64: [Select]
  1. _TITLE "Fernerator, press spacebar for new landscape, esc to quit" 'b+ 2020-08-06
  2. SCREEN _NEWIMAGE(1000, 600, 32)
  3. _DELAY .25
  4. WINDOW (-5, 0)-(5, 11)
  5.  
  6. TYPE obj
  7.     x AS SINGLE 'offset from centered fern
  8.     y AS SINGLE 'offest from centered fern
  9.     scale AS SINGLE ' from 0 to 1
  10.     c AS _UNSIGNED LONG
  11.  
  12. DIM SHARED nFerns
  13. REDIM SHARED fern(1 TO nFerns) AS obj
  14. '   f& = _LOADIMAGE("clipartkey_1043733.png")  ' the code isn't working with the image anymore???
  15.  
  16. initFerns
  17. wind = 0: dw = .01: dir = 1
  18. WHILE _KEYDOWN(27) = 0
  19.     IF INKEY$ = " " THEN initFerns
  20.     FOR i = 4 TO 11 STEP .2
  21.         LINE (-5, i)-(5, i + .2), _RGB32(60, (1 - i / 11) * 150 + 60, (1 - i / 11) * 75 + 180), BF
  22.     NEXT
  23.     FOR i = 0 TO 4 STEP .2
  24.         LINE (-5, i)-(5, i + .2), _RGB32(i / 4 * 90 + 10, i / 4 * 45 + 5, i / 4 * 22 + 2), BF
  25.     NEXT
  26.     ''''''''''''''''''''''''''''''''''''''''''''_PUTIMAGE (-5, 0), f&, 0 ' the code isn't working with the image anymore???
  27.  
  28.     FOR i = 1 TO nFerns
  29.         drawFern fern(i).x, fern(i).y, fern(i).scale, fern(i).c, wind
  30.     NEXT
  31.  
  32.     _DISPLAY
  33.     _LIMIT 10
  34.     wind = wind + dir * dw
  35.     IF wind > .06 OR wind < -.72 THEN dir = -dir
  36.  
  37. SUB initFerns
  38.     nFerns = 4 + INT(RND * 9)
  39.     REDIM fern(1 TO nFerns) AS obj
  40.     FOR i = 1 TO nFerns
  41.         fern(i).x = RND * 10 - 5
  42.         fern(i).y = RND * 2 - 1
  43.         fern(i).scale = RND * .7 + .3
  44.         g = RND * 100 + 40
  45.         fern(i).c = _RGB32(g - 20 - RND * 60, g, g - 20 - RND * 60)
  46.     NEXT
  47.  
  48. SUB drawFern (xoff0, yoff0, scale, c AS _UNSIGNED LONG, w)
  49.     yAdj = yoff0 + (1 - scale) * 5
  50.     FOR i = 1 TO 90000 'enough dots to get idea
  51.         SELECT CASE RND
  52.             CASE IS < .01
  53.                 nextX = 0
  54.                 nextY = .16 * y
  55.             CASE .01 TO .08
  56.                 nextX = .2 * x - .26 * y
  57.                 nextY = .23 * x + .22 * y + 1.6
  58.             CASE .08 TO .15
  59.                 nextX = -.15 * x + .28 * y
  60.                 nextY = .26 * x + .24 * y + .44
  61.             CASE ELSE
  62.                 nextX = .85 * x + .04 * y
  63.                 nextY = -.04 * x + .85 * y + 1.6
  64.         END SELECT
  65.         x = nextX + w * nextY / 10
  66.         y = nextY
  67.         LINE (x * scale + xoff0, y * scale + yAdj)-STEP(0, 0), c, BF
  68.     NEXT
  69.  
  70.  

EDIT: the code isn't working right with image any more, dang!

Also could alter the images my alternating the random rendering of x, y points so ferns dont look so cloned.
 
« Last Edit: February 20, 2021, 12:28:35 pm by bplus »

Offline AndyA

  • Newbie
  • Posts: 73
    • View Profile
Re: A dozen new and original IFS fractals
« Reply #8 on: February 20, 2021, 02:39:55 pm »
Those are clever changes to the plotting and post-rendering of the images, but I prefer using images for post processing the IFS like the attached pic. Using images for post processing allows me more flexibility in making a more realistic IFS picture. It's not everybody's cup of tea but I like it just fine.
Oak Leaves_grnPipes4IFS_ylwStarburst4Bknd.jpg
* Oak Leaves_grnPipes4IFS_ylwStarburst4Bknd.jpg (Filesize: 103.01 KB, Dimensions: 1024x755, Views: 252)
« Last Edit: February 20, 2021, 02:43:30 pm by AndyA »

Offline bplus

  • Global Moderator
  • Forum Resident
  • Posts: 8053
  • b = b + ...
    • View Profile
Re: A dozen new and original IFS fractals
« Reply #9 on: February 20, 2021, 10:04:37 pm »
@AndyA  well your post processing looks fabulous!
« Last Edit: February 20, 2021, 10:06:43 pm by bplus »

Offline AndyA

  • Newbie
  • Posts: 73
    • View Profile
Re: A dozen new and original IFS fractals
« Reply #10 on: February 21, 2021, 12:30:33 pm »
Thanks bplus,

I believe the leaf itself turned out well, the background on the other hand... well, it was used as a backdrop rather hurriedly.

Just a reminder, if you use the IFS Viewer 3 app in JustBasic (until I can motivate myself to do the port to QB64), you can 1) plot an IFS fractal that you like then 2) press the 'Render Using an Image' button, choose an image from disk that you want to color the fractal with 3) save the .BMP of the fractal rendered using an image disk. Keep in mind the JustBasic is like 100 times slower than QB64, so plotting, and rendering with an image will take minutes, instead of seconds.

For placing on a custom background you'll need to mess with MS Paint and Paint.net using a couple of simple procedures to drop the fractal onto a nice background.

P.S. I forgot about the BlitzPlus version of IFS Viewer 3. It's waaaay faster than the JustBasic version. It can be found here https://socoder.net/?Showcase=54548
« Last Edit: February 21, 2021, 12:38:28 pm by AndyA »

Offline OldMoses

  • Seasoned Forum Regular
  • Posts: 469
    • View Profile
Re: A dozen new and original IFS fractals
« Reply #11 on: February 21, 2021, 12:52:56 pm »
These are amazing. I wish I had the ability to understand the stuff behind it.

Another thing that Tricera-fract reminds me of, being a bit of a Trekkie, it looks like a slight variation of the Klingon symbol.

Offline AndyA

  • Newbie
  • Posts: 73
    • View Profile
Re: A dozen new and original IFS fractals
« Reply #12 on: February 21, 2021, 01:17:15 pm »
Hi OldMoses,

You know, I hadn't thought about it but, you're right I does look like a Klingon symbol. I'm surprised Johnno56, didn't mention that (just look at his avatar ).

[ edit]
Just a mild ribbing for Johnno56. I've talked to Johnno56 on and off over the last 5 years here and at other forums. I don't want him, or anyone else to think I meant anything mean or inappropriate. I meant it as a mild joke, but sometimes it doesn't seem like a joke in plain text.
[ /edit]
« Last Edit: February 21, 2021, 06:24:38 pm by AndyA »