You are not logged in or registered. Please login or register to use the full functionality of this board...
SIGN IN Join Our Community For FREE


From Mad Teddy's Fractal #2: Biomorphs
05-14-2017, 02:34 AM (This post was last modified: 05-14-2017 02:36 AM by bplus.)
Post: #1
 (Print Post)
From Mad Teddy's Fractal #2: Biomorphs
This is from one of the links Andy mentioned.

I colorized it and put it into loop so it changes slightly.

Code Snippet: [Select]
'radiolarians.bas for QB64 fork (B+=MGA) 2017-05-13
' rotolarians.bas SmallBASIC 0.12.9 (B+=MGA) 2017-05-13
' Mad Teddy's web pages Fractals #2 Biomorphs
' http://www.madteddy.com/biomorph.htm
' colorized mod, bplus

DIM sh, sw, i, j, n AS INTEGER
sh = 720: sw = 960

DIM cReal, cImag, aspRatio, ymax, ymin, xmax, xmin, x0, y0, x, y, xx, yy AS DOUBLE
cReal = .5: cImag = 0: aspRatio = sw / sh '4/3
ymax = 2.5: ymin = -ymax: xmax = ymax * aspRatio: xmin = -xmax

SCREEN _NEWIMAGE(sw, sh, 32)
_TITLE "Fractals #2 Biomorphs, colorized by bplus for QB64 Fork"

WHILE 1
   CLS
   FOR i = 0 TO sh
       FOR j = 0 TO sw
           x0 = xmin + (xmax - xmin) * j / sw
           y0 = -ymin - (ymax - ymin) * i / sh
           x = x0: y = y0
           FOR n = 1 TO 255
               xx = x * (x * x - 3 * y * y) + cReal
               yy = y * (3 * x * x - y * y) + cImag
               x = xx: y = yy
               IF ABS(x) > 10 OR ABS(y) > 10 OR x * x + y * y > 10 ^ 2 THEN EXIT FOR
           NEXT n
           IF n > 255 THEN n = 255
           IF x > 10 THEN x = 10
           IF x < 0 THEN x = 0
           IF y > 10 THEN y = 10
           IF y < 0 THEN y = 0
           PSET (j, i), _RGB(255 - x * 25, x * y * 2.5, y * 25)
       NEXT j
   NEXT i
   _DISPLAY
   cReal = cReal + .01
   'if cImag >= 0 then cImag = cImag - .1
WEND

As you can see, it has completely different look.


Attached File(s) Image(s)
   

B += _
Find all posts by this user
Like Post
08-13-2017, 03:19 AM
Post: #2
 (Print Post)
RE: From Mad Teddy's Fractal #2: Biomorphs
Nice! I like it. Big Grin
Find all posts by this user
Like Post
08-13-2017, 11:27 AM (This post was last modified: 08-13-2017 12:04 PM by bplus.)
Post: #3
 (Print Post)
RE: From Mad Teddy's Fractal #2: Biomorphs
Hi KingAshish, 

Yes, you probably like how I declared my types  :-))

B += _
Find all posts by this user
Like Post



Forum Jump:


User(s) browsing this thread: 1 Guest(s)




QB64 Member Project - Spiro Roses
QB64 Member Project - Pivet version one
QB64 Member Project - Dakapo
QB64 Member Project - Exit
QB64 Member Project - Input
QB64 Member Project - RGB Color Wheel
QB64 Member Project - Kobolts Monopoly
QB64 Member Project - Quarto
QB64 Member Project - Color Rotating Text
QB64 Member Project - Dreamy Clock
QB64 Member Project - Rubix's Magic
QB64 Member Project - Overboard
QB64 Member Project - Kings Court
QB64 Member Project - Blokus
QB64 Member Project - Touche
QB64 Member Project - Martin Fractals version one
QB64 Member Project - ARB Checkers
QB64 Member Project - Red Scrolling LED Sign
QB64 Member Project - Domain
QB64 Member Project - Basic Dithering
QB64 Member Project - Swirl
QB64 Member Project - MAPTRIANGLE
QB64 Member Project - Othello
QB64 Member Project - STxAxTIC 3D World
QB64 Member Project - Martin Fractals version four
QB64 Member Project - Foursight
QB64 Member Project - Kings Vallery version two
QB64 Member Project - Qubic
QB64 Member Project - Line Thickness
QB64 Member Project - Amazon
QB64 Member Project - Algeria Weather
QB64 Member Project - Rotating Background
QB64 Member Project - Point Blank
QB64 Member Project - Spinning Color Wheel
QB64 Member Project - OpenGL Triangles
QB64 Member Project - Splatter
QB64 Member Project - Color Triangles
QB64 Member Project - Martin Fractals version three
QB64 Member Project - Inside Moves
QB64 Member Project - Pivot version two
QB64 Member Project - Score 4
QB64 Member Project - Bowditch curve
QB64 Member Project - Sabotage
QB64 Member Project - Isolation
QB64 Member Project - Connect Four
QB64 Member Project - Martin Fractals version two
QB64 Member Project - Full Color LED Sign
QB64 Member Project - 9 Board
QB64 Member Project - Kings Valley verion one