QB64.org Forum

Active Forums => Programs => Topic started by: bplus on January 25, 2021, 04:12:42 pm

Title: Crop Circles
Post by: bplus on January 25, 2021, 04:12:42 pm
Crop circles: 2 color geometric design with shades of fractal or whatever looks intelligently designed or fun!

Crop Circles #3 mod
Code: QB64: [Select]
  1. _TITLE "Crop Circles #3" 'b+ trans and mod to QB64 2021-01-25
  2.  
  3. CONST Xmax = 730, Ymax = 730, Cx = Xmax / 2, Cy = Ymax / 2
  4. SCREEN _NEWIMAGE(Xmax, Ymax, 32)
  5. _DELAY .25
  6.  
  7. Hc = _RGB32(240, 220, 80): Lc = _RGB32(100, 50, 10): n = 12: stp = -40
  8. COLOR , Hc
  9. FOR br = 360 TO 0 STEP stp
  10.     shft = shft + 720 / (n * n)
  11.     FOR i = 1 TO n
  12.         x = Cx + br * COS(_D2R(i * 360 / n + shft))
  13.         y = Cy + br * SIN(_D2R(i * 360 / n + shft))
  14.         drawc x, y
  15.         _LIMIT 10
  16.     NEXT
  17.  
  18. SUB drawc (mx, my)
  19.     'local m,cr,dx,dy,dr,i,cc
  20.     cr = .5 * SQR((Cx - mx) ^ 2 + (Cy - my) ^ 2): m = .5 * cr
  21.     dx = (mx - Cx) / m: dy = (my - Cy) / m: dr = cr / m
  22.     FOR i = m TO 0 STEP -1
  23.         IF i MOD 2 = 0 THEN cc = Hc ELSE cc = Lc
  24.         x = Cx + dx * (m - i): y = Cy + dy * (m - i): r = dr * i
  25.         fcirc x, y, r, cc
  26.     NEXT
  27.  
  28. SUB fcirc (CX AS LONG, CY AS LONG, R AS LONG, C AS _UNSIGNED LONG)
  29.     DIM Radius AS LONG, RadiusError AS LONG
  30.     DIM X AS LONG, Y AS LONG
  31.     Radius = ABS(R): RadiusError = -Radius: X = Radius: Y = 0
  32.     IF Radius = 0 THEN PSET (CX, CY), C: EXIT SUB
  33.     LINE (CX - X, CY)-(CX + X, CY), C, BF
  34.     WHILE X > Y
  35.         RadiusError = RadiusError + Y * 2 + 1
  36.         IF RadiusError >= 0 THEN
  37.             IF X <> Y + 1 THEN
  38.                 LINE (CX - Y, CY - X)-(CX + Y, CY - X), C, BF
  39.                 LINE (CX - Y, CY + X)-(CX + Y, CY + X), C, BF
  40.             END IF
  41.             X = X - 1
  42.             RadiusError = RadiusError - X * 2
  43.         END IF
  44.         Y = Y + 1
  45.         LINE (CX - X, CY - Y)-(CX + X, CY - Y), C, BF
  46.         LINE (CX - X, CY + Y)-(CX + X, CY + Y), C, BF
  47.     WEND
  48.  
  49.  
  50.  
Title: Re: Crop Circles
Post by: johnno56 on January 25, 2021, 05:32:28 pm
You obviously have non-traditional aliens where you live...

Nicely done... Does it come in blue... lol  Kidding....
Title: Re: Crop Circles
Post by: Pete on January 25, 2021, 05:35:58 pm
I want a slower frames version, with a zoom feature... so I can see Steve on his tractor, making those crop circles. We all know it's him!!!

Pete
Title: Re: Crop Circles
Post by: SierraKen on January 25, 2021, 05:52:45 pm
Awesome B+! I decided to change one line to make the colors red and green to make it a flower.

Code: QB64: [Select]
  1. _TITLE "Crop Circles #3" 'b+ trans and mod to QB64 2021-01-25
  2.  
  3. CONST Xmax = 730, Ymax = 730, Cx = Xmax / 2, Cy = Ymax / 2
  4. SCREEN _NEWIMAGE(Xmax, Ymax, 32)
  5. _DELAY .25
  6.  
  7. 'Color mod by SierraKen to look like a flower.
  8. 'Hc = _RGB32(240, 220, 80): Lc = _RGB32(100, 50, 10): n = 12: stp = -40
  9. Hc = _RGB32(0, 255, 0): Lc = _RGB32(255, 0, 0): n = 12: stp = -40
  10. COLOR , Hc
  11. FOR br = 360 TO 0 STEP stp
  12.     shft = shft + 720 / (n * n)
  13.     FOR i = 1 TO n
  14.         x = Cx + br * COS(_D2R(i * 360 / n + shft))
  15.         y = Cy + br * SIN(_D2R(i * 360 / n + shft))
  16.         drawc x, y
  17.         _LIMIT 10
  18.     NEXT
  19.  
  20. SUB drawc (mx, my)
  21.     'local m,cr,dx,dy,dr,i,cc
  22.     cr = .5 * SQR((Cx - mx) ^ 2 + (Cy - my) ^ 2): m = .5 * cr
  23.     dx = (mx - Cx) / m: dy = (my - Cy) / m: dr = cr / m
  24.     FOR i = m TO 0 STEP -1
  25.         IF i MOD 2 = 0 THEN cc = Hc ELSE cc = Lc
  26.         x = Cx + dx * (m - i): y = Cy + dy * (m - i): r = dr * i
  27.         fcirc x, y, r, cc
  28.     NEXT
  29.  
  30. SUB fcirc (CX AS LONG, CY AS LONG, R AS LONG, C AS _UNSIGNED LONG)
  31.     DIM Radius AS LONG, RadiusError AS LONG
  32.     DIM X AS LONG, Y AS LONG
  33.     Radius = ABS(R): RadiusError = -Radius: X = Radius: Y = 0
  34.     IF Radius = 0 THEN PSET (CX, CY), C: EXIT SUB
  35.     LINE (CX - X, CY)-(CX + X, CY), C, BF
  36.     WHILE X > Y
  37.         RadiusError = RadiusError + Y * 2 + 1
  38.         IF RadiusError >= 0 THEN
  39.             IF X <> Y + 1 THEN
  40.                 LINE (CX - Y, CY - X)-(CX + Y, CY - X), C, BF
  41.                 LINE (CX - Y, CY + X)-(CX + Y, CY + X), C, BF
  42.             END IF
  43.             X = X - 1
  44.             RadiusError = RadiusError - X * 2
  45.         END IF
  46.         Y = Y + 1
  47.         LINE (CX - X, CY - Y)-(CX + X, CY - Y), C, BF
  48.         LINE (CX - X, CY + Y)-(CX + X, CY + Y), C, BF
  49.     WEND
  50.  
Title: Re: Crop Circles
Post by: bplus on January 25, 2021, 06:58:22 pm
I want a slower frames version, with a zoom feature... so I can see Steve on his tractor, making those crop circles. We all know it's him!!!

Pete

Sure, sure but not a tractor, QB64!  ;-))
Title: Re: Crop Circles
Post by: Pete on January 25, 2021, 07:11:38 pm
I lost a good first officer, adrift in space that way. I yelled to Ensign Steve, "Engage the tractor beam! To which he immediately went to the shuttle bay, and engaged the headlight on the John Deere. Oh well.

- Pete out.
Title: Re: Crop Circles
Post by: bplus on January 25, 2021, 07:26:41 pm
@johnno56 and @SierraKen  different colors huh?

OK let's take a look into my little bag of tricks...
Title: Re: Crop Circles
Post by: bplus on January 25, 2021, 09:21:15 pm
OK here is what my tractor beam from my ship can do:
Code: QB64: [Select]
  1. _TITLE "Crop Circles #3 Mod 1 Zap Color Changes" 'b+ trans and mod to QB64 2021-01-25
  2.  
  3. CONST Xmax = 1024, Ymax = 730, Cx = Xmax / 2, Cy = Ymax / 2
  4. SCREEN _NEWIMAGE(Xmax, Ymax, 32)
  5. _DELAY .25
  6. HighColr = _RGB32(240, 220, 80): LowColr = _RGB32(100, 50, 10)
  7. makeCCircle
  8.     _PUTIMAGE , CCircle, 0
  9.     WHILE _MOUSEINPUT: WEND 'aim with mouse
  10.     mx = _MOUSEX: my = _MOUSEY: mb = _MOUSEBUTTON(1)
  11.     drawShip mx, my, LowColr
  12.     IF mb THEN
  13.         PLC mx, my, Cx, Cy, 360
  14.         _DISPLAY
  15.         FlagChange = -1
  16.     END IF
  17.     IF FlagChange THEN
  18.         makeCCircle
  19.         FlagChange = 0
  20.     END IF
  21.     _DISPLAY
  22.  
  23. SUB makeCCircle
  24.     IF CCircle THEN _FREEIMAGE CCircle
  25.     CCircle = _NEWIMAGE(_WIDTH, _HEIGHT, 32)
  26.     _DEST CCircle
  27.     n = 12: stp = -40
  28.     COLOR , HighColr
  29.     CLS
  30.     FOR br = 360 TO 0 STEP stp
  31.         shft = shft + 720 / (n * n)
  32.         FOR i = 1 TO n
  33.             x = Cx + br * COS(_D2R(i * 360 / n + shft))
  34.             y = Cy + br * SIN(_D2R(i * 360 / n + shft))
  35.             drawc x, y
  36.         NEXT
  37.     NEXT
  38.     _DEST 0
  39.  
  40. SUB drawc (mx, my)
  41.     cr = .5 * SQR((Cx - mx) ^ 2 + (Cy - my) ^ 2): m = .5 * cr
  42.     dx = (mx - Cx) / m: dy = (my - Cy) / m: dr = cr / m
  43.     FOR i = m TO 0 STEP -1
  44.         IF i MOD 2 = 0 THEN cc = HighColr ELSE cc = LowColr
  45.         x = Cx + dx * (m - i): y = Cy + dy * (m - i): r = dr * i
  46.         fcirc x, y, r, cc
  47.     NEXT
  48.  
  49. SUB fcirc (CX AS LONG, CY AS LONG, R AS LONG, C AS _UNSIGNED LONG)
  50.     DIM Radius AS LONG, RadiusError AS LONG
  51.     DIM X AS LONG, Y AS LONG
  52.     Radius = ABS(R): RadiusError = -Radius: X = Radius: Y = 0
  53.     IF Radius = 0 THEN PSET (CX, CY), C: EXIT SUB
  54.     LINE (CX - X, CY)-(CX + X, CY), C, BF
  55.     WHILE X > Y
  56.         RadiusError = RadiusError + Y * 2 + 1
  57.         IF RadiusError >= 0 THEN
  58.             IF X <> Y + 1 THEN
  59.                 LINE (CX - Y, CY - X)-(CX + Y, CY - X), C, BF
  60.                 LINE (CX - Y, CY + X)-(CX + Y, CY + X), C, BF
  61.             END IF
  62.             X = X - 1
  63.             RadiusError = RadiusError - X * 2
  64.         END IF
  65.         Y = Y + 1
  66.         LINE (CX - X, CY - Y)-(CX + X, CY - Y), C, BF
  67.         LINE (CX - X, CY + Y)-(CX + X, CY + Y), C, BF
  68.     WEND
  69.  
  70. SUB PLC (baseX, baseY, targetX, targetY, targetR) ' PLC for PlasmaLaserCannon
  71.     r = RND ^ 2 * RND: g = RND ^ 2 * RND: b = RND ^ 2 * RND: hp = _PI(.5) ' red, green, blue, half pi
  72.     ta = _ATAN2(targetY - baseY, targetX - baseX) ' angle of target to cannon base
  73.     dist = _HYPOT(targetY - baseY, targetX - baseX) ' distance cannon to target
  74.     dr = targetR / dist
  75.     FOR r = 0 TO dist STEP .25
  76.         x = baseX + r * COS(ta)
  77.         y = baseY + r * SIN(ta)
  78.         C = C + .3
  79.         fcirc x, y, dr * r, _RGB32(128 + 127 * SIN(r * C), 128 + 127 * SIN(g * C), 128 + 127 * SIN(b * C))
  80.     NEXT
  81.     FOR rr = dr * r TO 0 STEP -.5
  82.         C = C + 1
  83.         LowColr = _RGB32(128 + 127 * SIN(r * C), 128 + 127 * SIN(g * C), 128 + 127 * SIN(b * C))
  84.         fcirc x, y, rr, LowColr
  85.     NEXT
  86.     cAnalysis LowColr, rr, gg, bb, aa
  87.     HighColr = _RGB32(255 - rr, 255 - gg, 255 - bb)
  88.  
  89. SUB cAnalysis (c AS _UNSIGNED LONG, outRed, outGrn, outBlu, outAlp)
  90.     outRed = _RED32(c): outGrn = _GREEN32(c): outBlu = _BLUE32(c): outAlp = _ALPHA32(c)
  91.  
  92. SUB drawShip (x, y, colr AS _UNSIGNED LONG) 'shipType     collisions same as circle x, y radius = 30
  93.     STATIC ls
  94.     DIM light AS LONG, r AS LONG, g AS LONG, b AS LONG
  95.     r = _RED32(colr): g = _GREEN32(colr): b = _BLUE32(colr)
  96.     fellipse x, y, 6, 15, _RGB32(r, g - 120, b - 100)
  97.     fellipse x, y, 18, 11, _RGB32(r, g - 60, b - 50)
  98.     fellipse x, y, 30, 7, _RGB32(r, g, b)
  99.     FOR light = 0 TO 5
  100.         fcirc x - 30 + 11 * light + ls, y, 1, _RGB32(ls * 50, ls * 50, ls * 50)
  101.     NEXT
  102.     ls = ls + 1
  103.     IF ls > 5 THEN ls = 0
  104.  
  105. SUB fellipse (CX AS LONG, CY AS LONG, xr AS LONG, yr AS LONG, C AS _UNSIGNED LONG)
  106.     IF xr = 0 OR yr = 0 THEN EXIT SUB
  107.     DIM x AS LONG, y AS LONG
  108.     w2 = xr * xr: h2 = yr * yr: h2w2 = h2 * w2
  109.     LINE (CX - xr, CY)-(CX + xr, CY), C, BF
  110.     DO WHILE y < yr
  111.         y = y + 1
  112.         x = SQR((h2w2 - y * y * w2) \ h2)
  113.         LINE (CX - x, CY + y)-(CX + x, CY + y), C, BF
  114.         LINE (CX - x, CY - y)-(CX + x, CY - y), C, BF
  115.     LOOP
  116.  
  117.  

Oh yeah! wear your laser safety glasses unless you have a welders helmet ;-))
Title: Re: Crop Circles
Post by: Pete on January 25, 2021, 10:03:56 pm
Okay, that was very amusing, to say the least. Ensign Steve, eat your heart out!

Pete
Title: Re: Crop Circles
Post by: SierraKen on January 25, 2021, 10:45:36 pm
The UFO is back!!! Run for your lives!!!!!!!! :D
Title: Re: Crop Circles
Post by: johnno56 on January 26, 2021, 07:16:52 am
You have excelled yourself yet again!!
Title: Re: Crop Circles
Post by: Dav on January 26, 2021, 08:11:47 am
Cool effect.  Nice coding!.

Edit:  I had to play around with it...

Code: QB64: [Select]
  1. _TITLE "Crop Circles #3 Mod 1 Zap Color Changes" 'b+ trans and mod to QB64 2021-01-25
  2.  
  3. CONST Xmax = 1024, Ymax = 730, Cx = Xmax / 2, Cy = Ymax / 2
  4. SCREEN _NEWIMAGE(Xmax, Ymax, 32)
  5. _DELAY .25
  6. HighColr = _RGB32(240, 220, 80): LowColr = _RGB32(100, 50, 10)
  7. makeCCircle
  8.     _PUTIMAGE , CCircle, 0
  9.     WHILE _MOUSEINPUT: WEND 'aim with mouse
  10.     mx = _MOUSEX: my = _MOUSEY: mb = _MOUSEBUTTON(1)
  11.     drawShip mx, my, LowColr
  12.     IF mb THEN
  13.         PLC mx, my, Cx, Cy, 360
  14.         _DISPLAY
  15.         FlagChange = -1
  16.     END IF
  17.     IF FlagChange THEN
  18.         makeCCircle
  19.         FlagChange = 0
  20.     END IF
  21.  
  22.  
  23.     temp& = _COPYIMAGE(_DISPLAY)
  24.     RotoZoom _WIDTH / 2, _HEIGHT / 2, temp&, 1, angle
  25.     angle = angle + 3: IF angle >= 360 THEN angle = angle - 360
  26.     _FREEIMAGE temp&
  27.     _DISPLAY
  28.     _DELAY .01
  29.  
  30.  
  31.  
  32. SUB makeCCircle
  33.     IF CCircle THEN _FREEIMAGE CCircle
  34.     CCircle = _NEWIMAGE(_WIDTH, _HEIGHT, 32)
  35.     _DEST CCircle
  36.     n = 12: stp = -40
  37.     COLOR , HighColr
  38.     CLS
  39.     FOR br = 360 TO 0 STEP stp
  40.         shft = shft + 720 / (n * n)
  41.         FOR i = 1 TO n
  42.             x = Cx + br * COS(_D2R(i * 360 / n + shft))
  43.             y = Cy + br * SIN(_D2R(i * 360 / n + shft))
  44.             drawc x, y
  45.         NEXT
  46.     NEXT
  47.     _DEST 0
  48.  
  49. SUB drawc (mx, my)
  50.     cr = .5 * SQR((Cx - mx) ^ 2 + (Cy - my) ^ 2): m = .5 * cr
  51.     dx = (mx - Cx) / m: dy = (my - Cy) / m: dr = cr / m
  52.     FOR i = m TO 0 STEP -1
  53.         IF i MOD 2 = 0 THEN cc = HighColr ELSE cc = LowColr
  54.         x = Cx + dx * (m - i): y = Cy + dy * (m - i): r = dr * i
  55.         fcirc x, y, r, cc
  56.     NEXT
  57.  
  58. SUB fcirc (CX AS LONG, CY AS LONG, R AS LONG, C AS _UNSIGNED LONG)
  59.     DIM Radius AS LONG, RadiusError AS LONG
  60.     DIM X AS LONG, Y AS LONG
  61.     Radius = ABS(R): RadiusError = -Radius: X = Radius: Y = 0
  62.     IF Radius = 0 THEN PSET (CX, CY), C: EXIT SUB
  63.     LINE (CX - X, CY)-(CX + X, CY), C, BF
  64.     WHILE X > Y
  65.         RadiusError = RadiusError + Y * 2 + 1
  66.         IF RadiusError >= 0 THEN
  67.             IF X <> Y + 1 THEN
  68.                 LINE (CX - Y, CY - X)-(CX + Y, CY - X), C, BF
  69.                 LINE (CX - Y, CY + X)-(CX + Y, CY + X), C, BF
  70.             END IF
  71.             X = X - 1
  72.             RadiusError = RadiusError - X * 2
  73.         END IF
  74.         Y = Y + 1
  75.         LINE (CX - X, CY - Y)-(CX + X, CY - Y), C, BF
  76.         LINE (CX - X, CY + Y)-(CX + X, CY + Y), C, BF
  77.     WEND
  78.  
  79. SUB PLC (baseX, baseY, targetX, targetY, targetR) ' PLC for PlasmaLaserCannon
  80.     r = RND ^ 2 * RND: g = RND ^ 2 * RND: b = RND ^ 2 * RND: hp = _PI(.5) ' red, green, blue, half pi
  81.     ta = _ATAN2(targetY - baseY, targetX - baseX) ' angle of target to cannon base
  82.     dist = _HYPOT(targetY - baseY, targetX - baseX) ' distance cannon to target
  83.     dr = targetR / dist
  84.     FOR r = 0 TO dist STEP .25
  85.         x = baseX + r * COS(ta)
  86.         y = baseY + r * SIN(ta)
  87.         C = C + .3
  88.         fcirc x, y, dr * r, _RGB32(128 + 127 * SIN(r * C), 128 + 127 * SIN(g * C), 128 + 127 * SIN(b * C))
  89.     NEXT
  90.     FOR rr = dr * r TO 0 STEP -.5
  91.         C = C + 1
  92.         LowColr = _RGB32(128 + 127 * SIN(r * C), 128 + 127 * SIN(g * C), 128 + 127 * SIN(b * C))
  93.         fcirc x, y, rr, LowColr
  94.     NEXT
  95.     cAnalysis LowColr, rr, gg, bb, aa
  96.     HighColr = _RGB32(255 - rr, 255 - gg, 255 - bb)
  97.  
  98. SUB cAnalysis (c AS _UNSIGNED LONG, outRed, outGrn, outBlu, outAlp)
  99.     outRed = _RED32(c): outGrn = _GREEN32(c): outBlu = _BLUE32(c): outAlp = _ALPHA32(c)
  100.  
  101. SUB drawShip (x, y, colr AS _UNSIGNED LONG) 'shipType     collisions same as circle x, y radius = 30
  102.     STATIC ls
  103.     DIM light AS LONG, r AS LONG, g AS LONG, b AS LONG
  104.     r = _RED32(colr): g = _GREEN32(colr): b = _BLUE32(colr)
  105.     fellipse x, y, 6, 15, _RGB32(r, g - 120, b - 100)
  106.     fellipse x, y, 18, 11, _RGB32(r, g - 60, b - 50)
  107.     fellipse x, y, 30, 7, _RGB32(r, g, b)
  108.     FOR light = 0 TO 5
  109.         fcirc x - 30 + 11 * light + ls, y, 1, _RGB32(ls * 50, ls * 50, ls * 50)
  110.     NEXT
  111.     ls = ls + 1
  112.     IF ls > 5 THEN ls = 0
  113.  
  114. SUB fellipse (CX AS LONG, CY AS LONG, xr AS LONG, yr AS LONG, C AS _UNSIGNED LONG)
  115.     IF xr = 0 OR yr = 0 THEN EXIT SUB
  116.     DIM x AS LONG, y AS LONG
  117.     w2 = xr * xr: h2 = yr * yr: h2w2 = h2 * w2
  118.     LINE (CX - xr, CY)-(CX + xr, CY), C, BF
  119.     DO WHILE y < yr
  120.         y = y + 1
  121.         x = SQR((h2w2 - y * y * w2) \ h2)
  122.         LINE (CX - x, CY + y)-(CX + x, CY + y), C, BF
  123.         LINE (CX - x, CY - y)-(CX + x, CY - y), C, BF
  124.     LOOP
  125.  
  126. SUB RotoZoom (X AS LONG, Y AS LONG, Image AS LONG, Scale AS SINGLE, Rotation AS SINGLE)
  127.     DIM px(3) AS SINGLE: DIM py(3) AS SINGLE
  128.     W& = _WIDTH(Image&): H& = _HEIGHT(Image&)
  129.     px(0) = -W& / 2: py(0) = -H& / 2: px(1) = -W& / 2: py(1) = H& / 2
  130.     px(2) = W& / 2: py(2) = H& / 2: px(3) = W& / 2: py(3) = -H& / 2
  131.     sinr! = SIN(-Rotation / 57.2957795131): cosr! = COS(-Rotation / 57.2957795131)
  132.     FOR i& = 0 TO 3
  133.         x2& = (px(i&) * cosr! + sinr! * py(i&)) * Scale + X: y2& = (py(i&) * cosr! - px(i&) * sinr!) * Scale + Y
  134.         px(i&) = x2&: py(i&) = y2&
  135.     NEXT
  136.     _MAPTRIANGLE _SEAMLESS(0, 0)-(0, H& - 1)-(W& - 1, H& - 1), Image& TO(px(0), py(0))-(px(1), py(1))-(px(2), py(2))
  137.     _MAPTRIANGLE _SEAMLESS(0, 0)-(W& - 1, 0)-(W& - 1, H& - 1), Image& TO(px(0), py(0))-(px(3), py(3))-(px(2), py(2))
  138.  
  139.  

- Dav
Title: Re: Crop Circles
Post by: Pete on January 26, 2021, 11:37:25 am
As Steve's attorney, I have to warn you against stealing his intellectual property. You know, ROTATING CROPS.

Help! I'm in a flat spin.......

Pete :D
Title: Re: Crop Circles
Post by: bplus on January 26, 2021, 12:16:08 pm
Ha! Dav now I know what the aliens saw just before they crashed in Roswell ;-))

Well I think the current crop circle design is getting old and we need to zap some new ones.

Some ideas:
https://www.google.com/search?q=crop+circles&client=opera&hs=Vr&sxsrf=ALeKk03o1a04wOu4VzeNoGFGFOaq87A6Xw:1611681406788&source=lnms&tbm=isch&sa=X&ved=2ahUKEwiIhPiNjbruAhUTBs0KHVIzBKAQ_AUoAXoECAgQAw&biw=1179&bih=606
Title: Re: Crop Circles
Post by: Pete on January 26, 2021, 01:30:13 pm
I have a comic I photoshopped to a site once regarding the Roswell incident.

It was a saucer, half embedded in the ground at a 45-degree angle, and around the hull of the saucer, I printed "Student Flyer"

Pete
Title: Re: Crop Circles
Post by: johnno56 on January 26, 2021, 01:59:01 pm
Dav,

Mr. Warhol would be jealous...

J
Title: Re: Crop Circles
Post by: _vince on January 26, 2021, 03:19:01 pm
Nice, bplus, it looks very much like Romanesco broccoli
Title: Re: Crop Circles
Post by: Pete on January 26, 2021, 03:57:05 pm
Nice, bplus, it looks very much like Romanesco broccoli


Stop encouraging him, Vince.Now he'll code it with cheese saucers.

Pete
Title: Re: Crop Circles
Post by: bplus on January 26, 2021, 05:13:49 pm
Thanks @vince, I had to remind myself that fractal veggie.

@Pete well cheese doesn't fly but flying cups, bowls, pans, egg timers or blenders, hmm... ;-)

Title: Re: Crop Circles
Post by: Pete on January 26, 2021, 05:18:02 pm
Flying blenders? Well, like the priest said, who visited Steve's farm... Holy Crop!

Pete
Title: Re: Crop Circles
Post by: bplus on January 26, 2021, 06:37:50 pm
Oh look what the blender dragged in:
Code: QB64: [Select]
  1. _TITLE "Crop Circles #3 Mod 2 Blender" 'b+ trans and mod to QB64 2021-01-25
  2.  
  3. CONST Xmax = 1024, Ymax = 730, Cx = Xmax / 2, Cy = Ymax / 2, nCrops = 4
  4. SCREEN _NEWIMAGE(Xmax, Ymax, 32)
  5. _DELAY .25
  6. REDIM SHARED LowColr AS _UNSIGNED LONG, HighColr AS _UNSIGNED LONG, cNum AS LONG
  7. HighColr = _RGB32(240, 220, 80): LowColr = _RGB32(100, 50, 10)
  8. crop0
  9.     _PUTIMAGE , CCircle, 0
  10.     WHILE _MOUSEINPUT: WEND 'aim with mouse
  11.     mx = _MOUSEX: my = _MOUSEY: mb = _MOUSEBUTTON(1)
  12.     drawShip mx, my, LowColr
  13.     IF mb THEN
  14.         PLC mx, my, Cx, Cy, 360
  15.         _DISPLAY
  16.         _DELAY .2
  17.         FlagChange = -1
  18.     END IF
  19.     IF FlagChange THEN
  20.         IF RND < .5 THEN
  21.             crop3
  22.         ELSE
  23.             cNum = (cNum + 1) MOD nCrops
  24.             SELECT CASE cNum
  25.                 CASE 0: crop0
  26.                 CASE 1: crop1
  27.                 CASE 2: crop2
  28.                 CASE 3: crop3
  29.             END SELECT
  30.         END IF
  31.         FlagChange = 0
  32.     END IF
  33.     _DISPLAY
  34.  
  35. 'crop0 uses this
  36. SUB drawc (mx, my)
  37.     cr = .5 * SQR((Cx - mx) ^ 2 + (Cy - my) ^ 2): m = .5 * cr
  38.     dx = (mx - Cx) / m: dy = (my - Cy) / m: dr = cr / m
  39.     FOR i = m TO 0 STEP -1
  40.         IF i MOD 2 = 0 THEN cc = HighColr ELSE cc = LowColr
  41.         x = Cx + dx * (m - i): y = Cy + dy * (m - i): r = dr * i
  42.         fcirc x, y, r, cc
  43.     NEXT
  44.  
  45. SUB fcirc (CX AS LONG, CY AS LONG, R AS LONG, C AS _UNSIGNED LONG)
  46.     DIM Radius AS LONG, RadiusError AS LONG
  47.     DIM X AS LONG, Y AS LONG
  48.     Radius = ABS(R): RadiusError = -Radius: X = Radius: Y = 0
  49.     IF Radius = 0 THEN PSET (CX, CY), C: EXIT SUB
  50.     LINE (CX - X, CY)-(CX + X, CY), C, BF
  51.     WHILE X > Y
  52.         RadiusError = RadiusError + Y * 2 + 1
  53.         IF RadiusError >= 0 THEN
  54.             IF X <> Y + 1 THEN
  55.                 LINE (CX - Y, CY - X)-(CX + Y, CY - X), C, BF
  56.                 LINE (CX - Y, CY + X)-(CX + Y, CY + X), C, BF
  57.             END IF
  58.             X = X - 1
  59.             RadiusError = RadiusError - X * 2
  60.         END IF
  61.         Y = Y + 1
  62.         LINE (CX - X, CY - Y)-(CX + X, CY - Y), C, BF
  63.         LINE (CX - X, CY + Y)-(CX + X, CY + Y), C, BF
  64.     WEND
  65.  
  66. SUB PLC (baseX, baseY, targetX, targetY, targetR) ' PLC for PlasmaLaserCannon
  67.     r = RND ^ 2 * RND: g = RND ^ 2 * RND: b = RND ^ 2 * RND: hp = _PI(.5) ' red, green, blue, half pi
  68.     ta = _ATAN2(targetY - baseY, targetX - baseX) ' angle of target to cannon base
  69.     dist = _HYPOT(targetY - baseY, targetX - baseX) ' distance cannon to target
  70.     dr = targetR / dist
  71.     FOR r = 0 TO dist STEP .25
  72.         x = baseX + r * COS(ta)
  73.         y = baseY + r * SIN(ta)
  74.         c = c + .3
  75.         fcirc x, y, dr * r, _RGB32(128 + 127 * SIN(r * c), 128 + 127 * SIN(g * c), 128 + 127 * SIN(b * c))
  76.     NEXT
  77.     FOR rr = dr * r TO 0 STEP -.5
  78.         c = c + 1
  79.         LowColr = _RGB32(128 + 127 * SIN(r * c), 128 + 127 * SIN(g * c), 128 + 127 * SIN(b * c))
  80.         fcirc x, y, rr, LowColr
  81.     NEXT
  82.     cAnalysis LowColr, rr, gg, bb, aa
  83.     HighColr = _RGB32(255 - rr, 255 - gg, 255 - bb)
  84.  
  85. ' PLC uses this
  86. SUB cAnalysis (c AS _UNSIGNED LONG, outRed, outGrn, outBlu, outAlp)
  87.     outRed = _RED32(c): outGrn = _GREEN32(c): outBlu = _BLUE32(c): outAlp = _ALPHA32(c)
  88.  
  89. SUB drawShip (x, y, colr AS _UNSIGNED LONG) 'shipType     collisions same as circle x, y radius = 30
  90.     STATIC ls
  91.     DIM light AS LONG, r AS LONG, g AS LONG, b AS LONG
  92.     r = _RED32(colr): g = _GREEN32(colr): b = _BLUE32(colr)
  93.     fellipse x, y, 6, 15, _RGB32(r, g - 120, b - 100)
  94.     fellipse x, y, 18, 11, _RGB32(r, g - 60, b - 50)
  95.     fellipse x, y, 30, 7, _RGB32(r, g, b)
  96.     FOR light = 0 TO 5
  97.         fcirc x - 30 + 11 * light + ls, y, 1, _RGB32(ls * 50, ls * 50, ls * 50)
  98.     NEXT
  99.     ls = ls + 1
  100.     IF ls > 5 THEN ls = 0
  101.  
  102. ' drawShip needs
  103. SUB fellipse (CX AS LONG, CY AS LONG, xr AS LONG, yr AS LONG, C AS _UNSIGNED LONG)
  104.     IF xr = 0 OR yr = 0 THEN EXIT SUB
  105.     DIM x AS LONG, y AS LONG
  106.     w2 = xr * xr: h2 = yr * yr: h2w2 = h2 * w2
  107.     LINE (CX - xr, CY)-(CX + xr, CY), C, BF
  108.     DO WHILE y < yr
  109.         y = y + 1
  110.         x = SQR((h2w2 - y * y * w2) \ h2)
  111.         LINE (CX - x, CY + y)-(CX + x, CY + y), C, BF
  112.         LINE (CX - x, CY - y)-(CX + x, CY - y), C, BF
  113.     LOOP
  114.  
  115. FUNCTION rand (low, high)
  116.     rand = RND * (high - low) + low
  117.  
  118.  
  119. SUB crop0
  120.     IF CCircle THEN _FREEIMAGE CCircle
  121.     CCircle = _NEWIMAGE(_WIDTH, _HEIGHT, 32)
  122.     _DEST CCircle
  123.     COLOR , HighColr
  124.     CLS
  125.     n = 12: stp = -40
  126.     FOR br = 360 TO 0 STEP stp
  127.         shft = shft + 720 / (n * n)
  128.         FOR i = 1 TO n
  129.             x = Cx + br * COS(_D2R(i * 360 / n + shft))
  130.             y = Cy + br * SIN(_D2R(i * 360 / n + shft))
  131.             drawc x, y
  132.         NEXT
  133.     NEXT
  134.     _DEST 0
  135.  
  136. SUB crop1
  137.     IF CCircle THEN _FREEIMAGE CCircle
  138.     CCircle = _NEWIMAGE(_WIDTH, _HEIGHT, 32)
  139.     _DEST CCircle
  140.     COLOR , HighColr
  141.     CLS
  142.     ga = 137.5: bn = 800
  143.     br = 9.5: lr = .5: r = br: dr = (br - lr) / bn
  144.     hc = 180: lc = 120: cr = (hc - lc) / bn
  145.     FOR n = 1 TO bn
  146.         x = Cx + 10 * SQR(n) * COS(_D2R(n * ga))
  147.         y = Cy + 10 * SQR(n) * SIN(_D2R(n * ga))
  148.         r = r - dr
  149.         fcirc x, y, r, LowColr
  150.     NEXT
  151.     _DEST 0
  152.  
  153. SUB crop2
  154.     IF CCircle THEN _FREEIMAGE CCircle
  155.     CCircle = _NEWIMAGE(_WIDTH, _HEIGHT, 32)
  156.     _DEST CCircle
  157.     'this needs big constrast of color
  158.     HighColr = _RGB32(RND * 80, RND * 80, RND * 80) ' field
  159.     LowColr = _RGB32(175 + RND * 80, 175 + RND * 80, 175 + RND * 80)
  160.     COLOR , HighColr
  161.     CLS
  162.     FOR i = 45 TO Xmax STEP 50
  163.         LINE (i, 0)-(i + 10, Ymax), LowColr, BF
  164.         LINE (0, i)-(Xmax, i + 10), LowColr, BF
  165.     NEXT
  166.     FOR y = 50 TO 650 STEP 50
  167.         FOR x = 50 TO Xmax STEP 50
  168.             fcirc x, y, 10, LowColr
  169.         NEXT
  170.     NEXT
  171.     _DEST 0
  172.  
  173. SUB crop3
  174.     IF CCircle THEN _FREEIMAGE CCircle
  175.     CCircle = _NEWIMAGE(_WIDTH, _HEIGHT, 32)
  176.     _DEST CCircle
  177.     COLOR , HighColr
  178.     CLS
  179.  
  180.     r0 = rand(1, 5) / 5: r1 = rand(1, 5) / 10: r2 = rand(1, 5) / 10
  181.     fc = rand(1, 200) / 10: st = rand(10, 500) / 1000
  182.     xol = 0
  183.     yol = 0
  184.     mol = 0
  185.     FOR i = 0 TO 120 STEP st
  186.         a0 = (i / r0) * (2 * _PI)
  187.         a1 = ((i / r1) * (2 * _PI)) * -1
  188.         x1 = Cx + (SIN(a0) * ((r0 - r1) * fc)) * 30
  189.         y1 = Cy + (COS(a0) * ((r0 - r1) * fc)) * 30
  190.         x2 = x1 + (SIN(a1) * ((r2) * fc)) * 30
  191.         y2 = y1 + (COS(a1) * ((r2) * fc)) * 30
  192.         IF mol = 0 THEN
  193.             mol = 1
  194.             xol = x2
  195.             yol = y2
  196.         ELSE
  197.             LINE (xol, yol)-(x2, y2), LowColr
  198.             xol = x2
  199.             yol = y2
  200.         END IF
  201.     NEXT
  202.  
  203.  
  204.     _DEST 0
  205.  
  206.  
Title: Re: Crop Circles
Post by: _vince on January 26, 2021, 07:28:18 pm
I remember seeing one of these fresh at a local farmer's market and I had to buy it.  It was the most beautiful thing ever.  Screw gifting flowers, imagine receiving one of these for a change.

I ate it raw like broccoli and it tasted like crap, compared to broccoli it's very hard and is relatively tasteless but whatever taste there is it's not very good, I ate the entire thing anyway (not at once).  Maybe it's better cooked?
Title: Re: Crop Circles
Post by: bplus on January 26, 2021, 08:15:24 pm
Quote
Screw gifting flowers, imagine receiving one of these for a change.

Sure and Valentine's Day is coming soon!
Title: Re: Crop Circles
Post by: Pete on January 26, 2021, 08:19:53 pm
It was all fun and games, until I had to stop to count Steve's damn dots!

Pete
Title: Re: Crop Circles
Post by: bplus on January 26, 2021, 08:54:30 pm
It was all fun and games, until I had to stop to count Steve's damn dots!

Pete

I know just what you mean!

Code: QB64: [Select]
  1. SCREEN _NEWIMAGE(xmax, ymax, 32)
  2. _DELAY .25
  3.     _PUTIMAGE , sc&, 0
  4.     FOR y = 50 TO ymax - 50 STEP 50
  5.         FOR x = 50 TO xmax - 50 STEP 50
  6.             fcirc x, y, 10, _RGB32(RND * 40, RND * 40, RND * 40, RND * 40)
  7.         NEXT
  8.     NEXT
  9.     _DISPLAY
  10.     _LIMIT 10
  11.  
  12.  
  13. SUB fcirc (CX AS INTEGER, CY AS INTEGER, R AS INTEGER, C AS _UNSIGNED LONG)
  14.     DIM Radius AS INTEGER, RadiusError AS INTEGER
  15.     DIM X AS INTEGER, Y AS INTEGER
  16.     Radius = ABS(R): RadiusError = -Radius: X = Radius: Y = 0
  17.     IF Radius = 0 THEN PSET (CX, CY), C: EXIT SUB
  18.     LINE (CX - X, CY)-(CX + X, CY), C, BF
  19.     WHILE X > Y
  20.         RadiusError = RadiusError + Y * 2 + 1
  21.         IF RadiusError >= 0 THEN
  22.             IF X <> Y + 1 THEN
  23.                 LINE (CX - Y, CY - X)-(CX + Y, CY - X), C, BF
  24.                 LINE (CX - Y, CY + X)-(CX + Y, CY + X), C, BF
  25.             END IF
  26.             X = X - 1
  27.             RadiusError = RadiusError - X * 2
  28.         END IF
  29.         Y = Y + 1
  30.         LINE (CX - X, CY - Y)-(CX + X, CY - Y), C, BF
  31.         LINE (CX - X, CY + Y)-(CX + X, CY + Y), C, BF
  32.     WEND
  33.  

Edit: new and maybe improved

Title: Re: Crop Circles
Post by: SierraKen on January 26, 2021, 11:14:54 pm
Soon someone is going to write a book about this thread.... and it will be in the paranormal section. o_o
Title: Re: Crop Circles
Post by: STxAxTIC on January 26, 2021, 11:17:16 pm
It'll be the Librarian who writes about this. Are crop circles pure art? ... or are they ... simulation of a real thing?! OOooOOOOo

I don't buy what the BBC documentary says, there's something real about crop circles.
Title: Re: Crop Circles
Post by: bplus on January 27, 2021, 01:52:36 am
Yeah I only know some of those designs have captured my imagination.
Title: Re: Crop Circles
Post by: Pete on January 27, 2021, 11:27:44 am
I had something that captured my imagination once, but my wife refused to pay the ransom to get it back. Hey, two dollars is two dollars.

Pete