I'm working on a project that procedurally generates images of galaxies like this one:
This sample was "hand drawn" (by waving the cursor around). See this pen: https://codepen.io/OpherV/pen/JQBKVq?editors=0110
I would like to procedurally generate these types of images, but rather than generate them at one go I'd like the generation be performed using a "drawing" process, that is, moving the drawing cursor in a pattern that achieves these visual structures.
The mouse-simulation code that I currently have is lifted directly from Louis Hoebregts' "Simulating Mouse Movement" article on CSS Tricks.
The principle function relies on Simplex noise:
const s = 0.001 * (speed / 100);
const noiseX = (noise.simplex3(1, 0, a * s) + 1) / 2;
const noiseY = (noise.simplex3(11, 0, a * s) + 1) / 2;
random += randomness / 1000;
const randX = noise.simplex3(1, 0, random) * window.innerWidth * 0.1;
const randY = noise.simplex3(3, 0, random) * window.innerHeight * 0.1;
const x = noiseX * innerWidth + randX;
const y = noiseY * innerHeight + randY;
updateMouse(x, y);
However this type of noise won't create the visuals I'm aiming for. Breaking down the visual structure I have in mind, we have a center-weighted blob and elliptical "arms". To achieve the former, I think more "drawing time" should be performed near the center (which creates the bright blobs inside), with less often "offshoots" performing more elliptic motion to make the latter.
I thought about somehow gradienting the Simplex noise so that it veers more towards the center, but I'm unsure how to go about doing that in 2d space. I'm also not certain how to proceed combining that with something that draws the "arms" of the galaxy.
Can you suggest an algorithm to achieve this? Thanks