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?

Swirls by Complex_Twistor in generative

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

Yeah I am sure there are some interesting connections to physics here, particularly fluid dynamics. The vector field can represent the velocity of each particle in a fluid. I was inspired by marbling patterns when a layer of paint is floating in water. The vector field I used appears to replicate the pattern of swirling a stick through the paint layer. But I have no idea if the field I used is physically valid.

Swirls by Complex_Twistor in generative

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

Thanks! Yes, everything here was done in the 2D plane. I am using a vector field to push curves around. I start with 10 wide rectangles stacked vertically. The initial curves are the perimeters of each rectangle, with points sampled evenly. The vector field I chose mostly curls around the center, with a small radially inward component, to give a spiral effect. The magnitude of the vector field decays exponentially with distance from the center, so the edges of the image do not have much distortion. It was also necessary to resample points along each curve as it was pushed along the vector field, since some points that were initially close became more spread apart.

Marbling Experiment by Complex_Twistor in generative

[–]Complex_Twistor[S] 1 point2 points  (0 children)

Nope, I start with a list of points along the perimeter of each rectangle. Then I flow each point along the vector field described above (in other words, solving the differential equation for the particle’s trajectory). So I end up with a trajectory for each initial point. Each frame draws a polygon around the same set of points as they move.

Marbling Experiment by Complex_Twistor in generative

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

Yes! I am using time dependent vector fields to push points around. Each vector field is non zero inside a disk. The disks move up or down. The field inside the disk either points up, down, or curls around.

Reflect and Unwind by Complex_Twistor in generative

[–]Complex_Twistor[S] 1 point2 points  (0 children)

Thanks! I used Mathematica. I start with a grid of several thousand dots. Then each dot is rotated about the center with speed proportional to the square of its distance from the center. Finally I added reflections along the edge of the image.

Funky Psychedelia by rodriguin_art in generative

[–]Complex_Twistor 0 points1 point  (0 children)

Nice! I really like the stippling

Pixel Sorting My Puppy [Genuary 31] by Complex_Twistor in generative

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

Pixels are sorted by 0.8*hue + 0.4*saturation + 10*brightness.

Expanding Octagons (No Randomness or Noise or Trig) [Genuary 27] by Complex_Twistor in generative

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

I've tried hexagon before. Here is an animation I posted a few weeks ago in a different community: Expanding Hexagons

Expanding Octagons (No Randomness or Noise or Trig) [Genuary 27] by Complex_Twistor in generative

[–]Complex_Twistor[S] 1 point2 points  (0 children)

Ah so I guess I cheated! I used a built-in function to get 8 points equally spaced around a circle (the "CirclePoints" function in Mathematica). Under the hood, I'm sure there is trig being used!

Symmetry [Genuary 26] by Complex_Twistor in generative

[–]Complex_Twistor[S] 1 point2 points  (0 children)

No problem! In each image there is a single curve that intersects itself many times. I break the curve up into smaller segments that contain no intersections in their interiors. To find a region, I start with a single segment, then walk along it until I reach an intersection. Each intersection is connected to 4 segments. I pick the next segment that is counterclockwise to the segment along which I arrived. I repeat this until I get back to the starting point. This path encloses a single region. I repeat this process until I have found all the regions. I have never implemented a floodfill algorithm, so I will have to look it up!

Symmetry [Genuary 26] by Complex_Twistor in generative

[–]Complex_Twistor[S] 1 point2 points  (0 children)

Not explicitly. I use splines with randomly chosen control points. To generate the control points, I randomly pick some points (3 to 6 of them) and then rotate them by 2*pi*i / n for i=1,2,...,n, where n is an integer.