JellyFish(raylib) lazarus / 39-Graphics ---------------------------------------------------------------------- Guva · 2025-07-25 12:31 Code translation from Oberon and Python. https://community.wolfram.com/groups/-/m/t/3516580 https://github.com/mebriki/MathPyLab/blob/main/jellyfish/jellyfish.ipy nb Code: Pascal  [Select][+][-]window.onload = function(){var x1 = document.getElementById("main_content_section"); if (x1) { var x = document.getElementsByClassName("geshi");for (var i = 0; i program AnimatedPoints; uses  Raylib, Math; const NUM_POINTS = 10000; var  t: Single = 0.0;  Points: array of TVector2; procedure CalculatePoint(x, y, t: Single; var px, py: Single);var  k, d, e, c, q: Single;begin  k := (4.0 + Sin(x / 11.0 + t * 8.0)) * Cos(x / 14.0);  e := y / 8.0 - 19.0;  d := Sqrt(k * k + e * e) + Sin(y / 9.0 + t * 2.0);  c := d * d / 49.0 - t;  q := 2.0 * Sin(k * 2.0) + Sin(y / 17.0) * k * (9.0 + 2.0 * Sin(y - d * 3.0));  px := q + 50.0 * Cos(c) + 200.0;  py := q * Sin(c) + d * 39.0 - 440.0;end; procedure Setup;begin  InitWindow(800, 800, 'Animated Points');  SetTargetFPS(60);  SetLength(Points, NUM_POINTS);end; procedure UpdateJellyPoints;var  x, y, k, e, d0, d, angle, q, c: Single;  i: integer;begin  t := t + 0.01;  for i := 0 to NUM_POINTS - 1 do  begin    x := i;    y := i / 41.0;     k := 5 * Cos(x/19) * Cos(y/30);    e := y/8 - 12;    d0 := Sqrt(k*k + e*e);    d := (d0*d0)/59 + 2;     angle := ArcTan2(k, e);    q := (4 * Sin(angle * 9) + 9 * Sin(d - t) -         (k/d) * (9 + 3*Sin(d*9 - t*16)));    c := (d*d)/7 - t;     Points[i].x := (q + 50*Cos(c)) * 2 + 800/2;    Points[i].y := (q*Sin(c) + d*45) * 2;  end;end; procedure DrawFrame;var  i: Integer;  px, py: Single;begin  px := 0; py := 0;  t := t + Pi / 240.0;  ClearBackground(BLACK);  for i := 0 to 9999 do  begin    CalculatePoint(i, i / 235.0, t, px, py);    DrawPixel(Round(px), Round(py), RayWhite );  end;  UpdateJellyPoints;  for i := 0 to NUM_POINTS - 1 do DrawPixelV(Points[i], WHITE);end; begin  Setup;  while not WindowShouldClose do  begin    BeginDrawing;      DrawFrame;    EndDrawing;  end;  CloseWindow;end. ---------------------------------------------------------------------- Fred vS · 2025-07-25 13:15 Quote from: Guva on July 25, 2025, 02:31:15 pmCode translation from Oberon and Python. https://community.wolfram.com/groups/-/m/t/3516580 https://github.com/mebriki/MathPyLab/blob/main/jellyfish/jellyfish.ipy nb WOOOW!  In your program code: Code: Pascal  [Select][+][-]window.onload = function(){var x1 = document.getElementById("main_content_section"); if (x1) { var x = document.getElementsByClassName("geshi");for (var i = 0; i program AnimatedPoints; uses  Raylib, Math;  You only added Raylib in the "uses" section, and no LCL interface is used. On your site https://github.com/GuvaCode, I only see packages for Lazarus. Where is the necessary Raylib.pas file located? ---------------------------------------------------------------------- Guva · 2025-07-25 13:19 Quote from: Fred vS on July 25, 2025, 03:15:34 pmYou only added Raylib in uses section and no LCL interface is used. In your site https://github.com/GuvaCode I see only packages for Lazarus. Where is that Raylib.pas that is needed? https://github.com/GuvaCode/ray4laz/blob/main/source/raylib.pas ---------------------------------------------------------------------- Fred vS · 2025-07-25 13:21 Quote from: Guva on July 25, 2025, 03:19:50 pmQuote from: Fred vS on July 25, 2025, 03:15:34 pmYou only added Raylib in uses section and no LCL interface is used. In your site https://github.com/GuvaCode I see only packages for Lazarus. Where is that Raylib.pas that is needed? https://github.com/GuvaCode/ray4laz/blob/main/source/raylib.pas Perfect, thanks and wooow again. ---------------------------------------------------------------------- Fred vS · 2025-07-25 13:33 Maybe, for this summer, change this: Code: Pascal  [Select][+][-]window.onload = function(){var x1 = document.getElementById("main_content_section"); if (x1) { var x = document.getElementsByClassName("geshi");for (var i = 0; i   {$IFDEF LINUX} 'libraylib.so'; {$IFEND}  {$IFDEF DARWIN} 'libraylib.dylib'; {$IFEND}  {$IFDEF HAIKU} 'libraylib.so'; {$IFEND} with this: Code: Pascal  [Select][+][-]window.onload = function(){var x1 = document.getElementById("main_content_section"); if (x1) { var x = document.getElementsByClassName("geshi");for (var i = 0; i   {$IFDEF UNIX}   {$IFDEF DARWIN} 'libraylib.dylib';   {$ELSE} 'libraylib.so'; {$IFEND}  // for Linux, FreeBSD, NetBSD, OpenBSD, DragonFly, Haiku  {$IFEND} ---------------------------------------------------------------------- Guva · 2025-07-25 13:44 Quote from: Fred vS on July 25, 2025, 03:33:33 pmMaybe, for this summer, change this: Code: Pascal  [Select][+][-]window.onload = function(){var x1 = document.getElementById("main_content_section"); if (x1) { var x = document.getElementsByClassName("geshi");for (var i = 0; i   {$IFDEF LINUX} 'libraylib.so'; {$IFEND}  {$IFDEF DARWIN} 'libraylib.dylib'; {$IFEND}  {$IFDEF HAIKU} 'libraylib.so'; {$IFEND} with this: Code: Pascal  [Select][+][-]window.onload = function(){var x1 = document.getElementById("main_content_section"); if (x1) { var x = document.getElementsByClassName("geshi");for (var i = 0; i   {$IFDEF UNIX}   {$IFDEF DARWIN} 'libraylib.dylib';   {$ELSE} 'libraylib.so'; {$IFEND}  // for Linux, FreeBSD, NetBSD, OpenBSD, DragonFly, Haiku  {$IFEND} Oh, yes, I did. Tnx ---------------------------------------------------------------------- Fred vS · 2025-07-25 13:59 Quote from: Guva on July 25, 2025, 03:44:50 pmOh, yes, I did. Tnx I will try this end of summer to build + test RayLib on FreeBSD 64/32, NetBSD 64, OpenBSD 64/32 and Mac OSX + XQuartz, if you want I can give you the binaries of the libs. ---------------------------------------------------------------------- Guva · 2025-07-25 14:06 Quote from: Fred vS on July 25, 2025, 03:59:59 pmI will try this end of summer to build + test RayLib on FreeBSD 64/32, NetBSD 64, OpenBSD 64/32 and Mac OSX + XQuartz, if you want I can give you the binaries of the libs. Oh, that would be wonderful. ---------------------------------------------------------------------- Fred vS · 2025-07-29 18:57 Quote from: Guva on July 25, 2025, 04:06:55 pmOh, that would be wonderful. ray4laz is wonderful too on FreeBSD, OpenBSD and NetBSD.