Programming Differential Growth

  Рет қаралды 3,584

Programming Chaos

Programming Chaos

Күн бұрын

Пікірлер: 34
@KaletheQuick
@KaletheQuick Жыл бұрын
Keep up the good stuff, Terry!
@programmingchaos8957
@programmingchaos8957 Жыл бұрын
Thanks! Anything you're interested in seeing?
@maxmustermann3938
@maxmustermann3938 4 ай бұрын
If I find the time, I'll implement this on the GPU. If anyone else is interested, my concrete idea to do this would be: - preallocate a buffer with an upper bound for how many particles can exist - keep an atomic counter for the current amount of particles - initialize particles with a sorting key t, for example uniform from 0 for the first particle and 1 for the last particle, with the others having ascending values in between - when a particle is added, you increment the counter and add it to the end of the buffer. You assign it the mean of the two keys. Special treatment is needed when inserting between the first and last particle due to the circular nature of the list - sort all particles by t (since I like to use CUDA, this is trivial, there are GPU sorting algorithms you can just use pre-implemented there, otherwise you need to code it yourself or find an implementation somewhere) Forces etc. are straightforward, the list is stored as a packed linear array after all. However, the repulsion/attraction needs to consider all particles, so in order to avoid iterating over all of them you need a spatial datastructure to accelerate this. The "gravitational" force could be approximated using an quadtree for example which averages information together, and then you use the averaged information for things that are further away.
@programmingchaos8957
@programmingchaos8957 4 ай бұрын
This sounds like a great idea. If you implement it I would be very interested in seeing the results.
@maxmustermann3938
@maxmustermann3938 4 ай бұрын
Edit: sorry, my previous reply was thinking about another video I commented on. I haven't implemented this one yet, I was thinking of the procedural generation with constraints when I typed this reply out earlier.
@noricc
@noricc Жыл бұрын
A couple of years ago I remember seeing the Nervous System design studio making some really beautiful designs using this technique, and I would have loved to see such a nice explanation of the algorithm. Thanks!
@programmingchaos8957
@programmingchaos8957 Жыл бұрын
I'm really glad it was helpful. I'm always looking for new interesting projects. If you know of other interesting systems where the underlying algorithm wasn't clearly presented feel free to let me know. This video was based on a subscriber's suggestion.
@duality4y
@duality4y Жыл бұрын
all of this is incredibly good!! enjoying it so much :)
@programmingchaos8957
@programmingchaos8957 Жыл бұрын
I'm really glad to hear it!
@StevesMakerspace
@StevesMakerspace 5 ай бұрын
Excellent video. Thank you, Terry! I ported this to p5js and will leave a link separately, but you'll have to pick it out of your "held for review" comments.
@programmingchaos8957
@programmingchaos8957 5 ай бұрын
I'm very glad you enjoyed. A p5js version should be very cool. I'll keep an eye out for the link. Thanks.
@StevesMakerspace
@StevesMakerspace 5 ай бұрын
@@programmingchaos8957 Discovered it's got some kind of error. It was working well in a circle, but other shapes make it go beserk.
@StevesMakerspace
@StevesMakerspace 5 ай бұрын
@@programmingchaos8957 I fixed some errors in my code. Works better now.
@programmingchaos8957
@programmingchaos8957 5 ай бұрын
Great! Do you have a link?
@StevesMakerspace
@StevesMakerspace 5 ай бұрын
@@programmingchaos8957 I just replied with it, but it will be in your comments for review.
@Rockyzach88
@Rockyzach88 4 ай бұрын
Now make them a slider and have it draw faster or draw slower based on another "render speed" slider or something like that. Make another "random parameter set" button that randomly picks values for the slider parameters. So much stuff you could do with this. For some reason I have a fixation on the disjoint set data structure we used to make mazes in one of my classes. I wonder if I could implement it in something like this to make something interesting. The maze like structures reminded me of it.
@programmingchaos8957
@programmingchaos8957 4 ай бұрын
Great suggestion! I think Processing has a some interface libraries that include easy to use sliders. Part of my goal is definitely just to present a 'starter' project for people to build on. If you do extend it post a comment, I'd love to hear how it worked. I've seen projects that used more complex starting shapes, like letters, for the growth. Maybe starting with a simple maze and having this add twists and dead-ends?
@prietjepruck
@prietjepruck Жыл бұрын
Terry your videos always make me happy. I learn a ton of your programing. Something I am struggling with now is soft body simulation. Maybe an idea for a future tutorial :-).
@programmingchaos8957
@programmingchaos8957 Жыл бұрын
Thank you! I'll have to check out soft body simulations. I've only worked with them in the context of game engines where they are basically already programmed and you just set the parameters.
@duality4y
@duality4y Жыл бұрын
this is what it makes me think of: Brains, Coral, Diffusion of liquids, Convection in gasses/liquids/fluids, Fractals (when you start out without random perturbations)
@programmingchaos8957
@programmingchaos8957 Жыл бұрын
The forms generated are definitely fractal. Differential growth is probably a good model for some of the processes you listed. Reaction-Diffusion (kzbin.info/www/bejne/eYCwp5qKgbmqbMk) generates some very similar patterns and I think is a better model for some of the other processes.
@frodo279
@frodo279 4 ай бұрын
Awesome videos! Reminds me of chemical morphogenesis by turning
@programmingchaos8957
@programmingchaos8957 4 ай бұрын
Thank you! Your comment is on the differential growth video, have you checked out the diffusion reaction video: kzbin.info/www/bejne/eYCwp5qKgbmqbMk I think that is a model of chemical morphogenesis, although that's not the term I'm familiar with.
@frodo279
@frodo279 4 ай бұрын
@@programmingchaos8957 ahhh! The equations are similar to the chemical morphogenesis! Fun fact this is prolly one of Turing's less known contributions but one of my favorite!
@tiagotiagot
@tiagotiagot Жыл бұрын
Linking in the comments is probably a bad idea; KZbin's spam filter is a bit trigger-happy, when it is doing anything at all...
@SteveTaylorNZ
@SteveTaylorNZ Жыл бұрын
Agreed. Is there somewhere where those of us interested in this kind of thing can share/collaborate freely, including sharing code and links with each other?
@programmingchaos8957
@programmingchaos8957 Жыл бұрын
Thanks for the warning about links in the comments. I'll try to keep an eye on them. I haven't set up a good sharing site. But for processing there is openprocessing - a site for sharing sketches.
@dragolov
@dragolov Жыл бұрын
Bravo!
@programmingchaos8957
@programmingchaos8957 Жыл бұрын
Thank you!
@wondernow5627
@wondernow5627 8 ай бұрын
I'm really enjoy your explanation with drawing it is simple and clear, but I find explanation with code is a little bit complicated.
@programmingchaos8957
@programmingchaos8957 8 ай бұрын
I'm glad the drawings help with the explanation. Was there something about the code that was particularly confusing? I do rush a bit to try to keep these a reasonable length. Maybe slowing down would help?
@azco88
@azco88 10 ай бұрын
how can i create 3d models using the data
@programmingchaos8957
@programmingchaos8957 10 ай бұрын
A simple approach is to shift the whole structure through the z-axis as it grows. This will give a horn-like form, starting with a small circle and expanding into the complex wide end. However, I assume you want the whole model in 3D. That's more complex. Basically in this version there's a ring of particles and we're measuring the forces between them. For a 3D model you need to start with a sphere of particles and apply the forces between the particles. In a sphere each particle has more than two neighbors. It can be 3, 4, or more depending on how you decide to connect them. As the sphere grows (the same way our ring does) you look at the distance between sets of particles and decide when to add new ones.
Program an Invisibility Cloak and other Cool Effects
21:06
Programming Chaos
Рет қаралды 590
FASTEST Way To Learn Coding and ACTUALLY Get A Job
10:44
Brian Cache
Рет қаралды 1,2 МЛН
How To Choose Mac N Cheese Date Night.. 🧀
00:58
Jojo Sim
Рет қаралды 89 МЛН
World’s strongest WOMAN vs regular GIRLS
00:56
A4
Рет қаралды 52 МЛН
Увеличили моцареллу для @Lorenzo.bagnati
00:48
Кушать Хочу
Рет қаралды 8 МЛН
Disrespect or Respect 💔❤️
00:27
Thiago Productions
Рет қаралды 43 МЛН
Why is listening so HARD?
14:32
Refold
Рет қаралды 3,4 М.
Programming Flow Fields
30:27
Programming Chaos
Рет қаралды 3,4 М.
An Evolutionary Version of Particle Life
29:45
Programming Chaos
Рет қаралды 22 М.
Program a Chaotic Strange Attractor
20:55
Programming Chaos
Рет қаралды 1 М.
Programming Particle Life
36:43
Programming Chaos
Рет қаралды 9 М.
Master Go Programming With These Concurrency Patterns (in 40 minutes)
46:15
Procedurally animate limbs with inverse kinematics
33:45
Programming Chaos
Рет қаралды 2,7 М.
Dear Functional Bros
16:50
CodeAesthetic
Рет қаралды 553 М.
Optimize anything with Evolution: Programming Genetic Algorithms
37:20
Programming Chaos
Рет қаралды 1,3 М.
How To Choose Mac N Cheese Date Night.. 🧀
00:58
Jojo Sim
Рет қаралды 89 МЛН