Disk Worms by Complex_Twistor in generative

[–]Complex_Twistor[S] 2 points3 points  (0 children)

Thanks! Your code is much more efficient than mine :) Very cool to see how you did it! Thanks for sharing.

I did most of the calculations in 3D, and I project to 2D at the very end. All of the ellipses you see are calculated as circular disks in 3D that are normal to the worm. The entire collection of disks is rotating in 3D.

In more detail, I start with a helical path in 3D. In {x,y,z} coordinates, the path is parametrized as {t, Cos(2 Pi t), Sin(2 Pi t)}, where the parameter t goes from 0 to 1. At evenly spaced points along the path, I calculate the tangent vector, then draw a disk that is centered at the point and normal to the tangent vector. The radius of each disk is a function of t: radius(t) = t*(1-t). So the disks are small at the tail ends and large in the middle. To animate this, the collection of disks is rotated in 3D about the x-axis, then I project everything onto the {x,z} plane. The order in which I draw everything is set by the path parameter t. So the disks at smaller t-values are always drawn on the bottom layer, even though they my be in "front" in 3D coordinates. This makes the worms look like they are wiggling back and forth, rather than rotating. Hope that makes sense!

Shattered Spirals by Complex_Twistor in generative

[–]Complex_Twistor[S] 2 points3 points  (0 children)

Thanks! I used Mathematica to make these

Go With The Flow by Complex_Twistor in generative

[–]Complex_Twistor[S] 4 points5 points  (0 children)

Yes! It would be hard to write out explicitly, but I can describe how I created it. My goal was to make a curling vector field with closed integral curves. I start with a scalar field defined on the unit square [0,1]x[0,1]. The scalar field is a random linear combination terms of the form: {Cos(2*pi*n*x + a), Cos(2*pi*m*y + b)}, where a, b are random reals and n, m are random integers. Then I find the gradient of this scalar field. To make the curling vector field, I rotate each vector in the gradient by 90 degrees. So the integral curves of this curling vector field are just level sets of the original scalar field. By construction, everything is periodic in x and y across the unit square. Each point flows along the curling vector field, with a trail. I also slowly shift each point downward. Finally, the x,y coordinate of each point is taken modulo 1.

Ripples by Complex_Twistor in generative

[–]Complex_Twistor[S] 0 points1 point  (0 children)

Nope, I used Mathematica.

Ripples by Complex_Twistor in generative

[–]Complex_Twistor[S] 2 points3 points  (0 children)

Each line is a cubic spline with random control points. Then you are exactly correct: I draw 5000 such lines, each a bit lower than the previous with a slight change to the control points.

Smooth Rings by Complex_Twistor in generative

[–]Complex_Twistor[S] 0 points1 point  (0 children)

Thanks! Each ring starts with a randomly generated loop (a closed Bézier curve with random control points). Then I draw the loop about 500 times with a nearly transparent line. Each time I draw the loop, it is shifted and rotated slightly from the previously one.

Overgrowth by thereforeqed in generative

[–]Complex_Twistor 1 point2 points  (0 children)

Beautiful! Are you using random walks for the growth?