Author Topic: Tree Swirl  (Read 763 times)

B+

• Sr. Member
• Posts: 498
Tree Swirl
« on: 28. May 2017, 05:26:11 »

Code: [Select]
`' tree swirl.bas SmallBASIC 0.12.9 (B+=MGA) 2017-05-27' mod with trees' Psychedelic Star Swirl.bas  SmallBASIC 0.12.8 [B+=MGA] 2017-03-03cx = xmax / 2 : cy = ymax / 2 : StartAngle = 0clr = 1 : r = rnd : g = rnd : b = rndwhile 1  cls   Bang  showpage  delay 1  StartAngle = StartAngle - pi/72wend sub Bang()  angle = StartAngle  size = 3 : radius = .1 : ds = .1  while radius < 400    x = cos(angle) * radius    y = sin(angle) * radius    chColor     branch cx + x, cy + y, deg(atan2((y-cy),(x-cx))-90), size, 1    angle = angle + 41.0    radius = radius + 2.0    size = size + ds    ds = ds + 0.0001  wendendsub chColor()  clr = clr + 1  color rgb(30+20*sin(r*clr), 167+80*sin(g*clr), 30+20*sin(r*clr))  if clr > 10000 then r = rnd : g = rnd : b = rnd : clr = 0endsub branch(x, y, angD, length, lev)  local x2, y2, dx, dy, bc, i  x2 = x + cos(rad(angD)) * length  y2 = y - sin(rad(angD)) * length   line x, y, x2, y2  if lev>6 or length<1 then exit sub  lev+=1  branch x2,y2,angD+10+30*rnd,.8*length+.2*rnd*length,lev  branch x2,y2,angD-10-30*rnd,.8*length+.2*rnd*length,levend`

jj2007

• Full Member
• Posts: 138
• MasmBasic rocks
Re: Tree Swirl
« Reply #1 on: 28. May 2017, 18:02:09 »
Beautiful!

B+

• Sr. Member
• Posts: 498
Re: Tree Swirl
« Reply #2 on: 28. May 2017, 18:36:43 »

Galileo

• Jr. Member
• Posts: 77
Re: Tree Swirl
« Reply #3 on: 31. May 2017, 19:21:02 »
Very good.