Help With Particle System Shape
Hello friendly coders!
I am using a jit.world to make a particle system and am following Federico's Amazing Max Stuff tutorial.
Currently, my particles are contained in a cube shape. Can you help me figure out how to contain them within a sphere shape instead?
Hey hey,
they are a cube because they are initially placed using random numbers evenly spaced between -1 and 1.
You could normalise their initial position vector to get a position placed always at 1 unit from the centre.
Then you could use a random number to randomise it and so get it inside the sphere.
Here's the patch
And adding [sqrt] in the jit.gen just after [in 1] will generate an even distribution of particles. See https://programming.guide/random-point-within-circle.html for an explanation of why