Group Abstract Group Abstract

Message Boards Message Boards

Magnoquill Driftflare Quiverbloom: translating from P5.JS processing to Wolfram

Magnoquill Driftflare Quiverbloom: translating from P5.JS processing to Wolfram

Attachments:
POSTED BY: Vitaliy Kaurov
5 Replies

That's a pretty neat idea! Thank you @Henrik:

enter image description here

POSTED BY: Vitaliy Kaurov

Dear Vitaliy, this is very nice - and surprisingly easy - thanks for sharing!

The little remark I want to make here: Due to the way this point set is constructed, the points are "in order", i.e. instead of Point[pts] one can use Line[pts]. Then it might look even more "realistic"

Best regards -- Henrik

POSTED BY: Henrik Schachner

Cool!

With a few changes I made this compilable:

func = FunctionCompile@Function[{Typed[t, "Real64"]},
   Table[
    Module[{x, y, k, e, d, q, c, xp, yp}, x = i;
     y = i/235.;
     k = (4 + Sin[x/11. + 8*t])*Cos[x/14.];
     e = y/8 - 19;
     d = Sqrt[k^2 + e^2] + Sin[y/9 + 2*t];
     q = 2*Sin[2*k] + Sin[y/17.]*k*(9 + 2*Sin[y - 3*d]);
     c = d^2/49 - t;
     xp = q + 50*Cos[c] + 200;
     yp = q*Sin[c] + d*39 - 440;
     {xp, 400 - yp}
     ],
    {i, 9999, 0, -1}
    ]
   ]

Now generating the video was much faster:

AnimationVideo[
    Graphics[
        {White, Opacity[.9], PointSize[.002], Point[func[t]]},
        PlotRange -> {{70, 330}, {30, 350}},
        Background -> GrayLevel[9/255],
        Axes -> False, ImageSize -> Large
    ],
    {t, 0., 2.*Pi}
]

bug

POSTED BY: Daniel Sanchez

Here is an attempt for a python version: https://github.com/mebriki/MathPyLab/tree/main/creature

POSTED BY: Mohamed E. BRIKI

enter image description here -- you have earned Featured Contributor Badge enter image description here Your exceptional post has been selected for our editorial column Staff Picks http://wolfr.am/StaffPicks and Your Profile is now distinguished by a Featured Contributor Badge and is displayed on the Featured Contributor Board. Thank you!

POSTED BY: EDITORIAL BOARD
Reply to this discussion
Community posts can be styled and formatted using the Markdown syntax.
Reply Preview
Attachments
Remove
or Discard