"Those are some really beautiful meatballs" ~ Daniel Shiffman, 2016
@americanengineering20636 жыл бұрын
it's pretty clear that he didnt mean to say meth balls
@NStripleseven4 жыл бұрын
American Engineering Meth balls?
@dumbidiot1119 Жыл бұрын
@@americanengineering2063 breaking bad reference??
@Smomid5 жыл бұрын
this guy blows my mind with his genius
@gloverelaxis5 жыл бұрын
Thank you so much for your years of hard work, boundless enthusiasm, and clarity of thought and language. These videos are an absolute treasure; they are so much fun to watch and they're such an inspiration to get excited about math and coding.
@azyfloof7 жыл бұрын
Oh man, I love all the Coding Train videos I've watched lately, but this one speaks to me :D I remember coding metaball "screensavers" many years ago in QBASIC, and I remember the incredibly old and slow laptop I first tried in on. It had a 16 grey level LCD screen, and rendered a frame every few minutes or so :P Several months later and I had a faster colour laptop that could run it properly. Still slow, but fast enough to appreciate it. This video brings it all back!
@TheCodingTrain7 жыл бұрын
hah, thanks for the nice feedback!
@janknoblich41298 жыл бұрын
Mettballs actually means meatball in german :D 0:02
@nightshademagia7 жыл бұрын
TheHawrk He ACTUALLY said Meatballs. In a different language, but he STILL SAID IT.
@calebsherman8866 жыл бұрын
Bazinga
@timmyanimations83214 жыл бұрын
wow.
@Shockszzbyyous7 жыл бұрын
I gave my metaballs gravity, and now it's kinda like a lavalamp, except there is no convection from up to down.
@pete56687 жыл бұрын
I think you should make them more like meatballs, with melted cheese stretching between the balls as they move around the screen.
@Bloom_HD7 жыл бұрын
Shockszzbyyous maybe do something like for(var a = 0 ; a = 20 ; a++) { metaball.y = height*(cos(Pi/a)/1.2); if (a == 19) { a = 0; } } Something like that might make the metaball float up and down repeatedly.
@Bunny99s5 жыл бұрын
Well you can add actual convection. If a metaball is close to the bottom, increase it's energy / heat over time. The higher the temperature, the more upwards force you apply. If the metaball is closer to the top you let it loose energy / heat. So "cold" objects drop slowly to the bottom, hot objects will rise to the top. Blobs might have a slight repulsive force when they are really close to get a bit more side way motion
@gdor113 жыл бұрын
meat planets
@thatsmaik3 жыл бұрын
@@Bunny99s Thats a great excercise, thanks! :D
@johnvonhorn29425 жыл бұрын
Message from Mr Rogers, "you're the nicest guy in the neighborhood". Thanks so much for these great tutorials.
@bencebalaton5 жыл бұрын
The real question is: are PVectors stored in the MetaBalls? Great tutorial as always!!
@error.418 Жыл бұрын
I get the reference, but in this case MetaBalls are stored in the PVectors 🫡
@nctrn076 жыл бұрын
i clicked on this because i thought it was meatballs, very disappointed
@borekworek696 жыл бұрын
What's your favourite color? Me: 13:58
@tehsimo8 жыл бұрын
Infectious enthusiasm! pumped to go write a heat map visualisation from this
@alijayameilio8 жыл бұрын
better to times the color with 255, because radius / distance will give perfect 1 on the radius of the circle
@earthbjornnahkaimurrao95426 жыл бұрын
17:20 - you have a funny way of finding the average.
@akashchoudhary81623 жыл бұрын
Actually doing it that way ensures that you don't overflow the data type. If you do it like (a + b)/2 then there's a possibility that (a+b) might overflow the data type. But doing it the way he does it will never overflow, as he is adding half of the difference.
@joesharp35806 жыл бұрын
I love these coding challenges. Great work Daniel
@angledcoathanger8 жыл бұрын
These videos are so incredible! It's great having visual feedback for so many of the challenges. Would you ever consider doing something audio or synthesis based? Maybe even using Pure Data?
@soufianesalhi88028 жыл бұрын
dude you make code such a fun, i wish if my programmation professor was like you ! thanks for the good videos and keep coding !
@TheCodingTrain8 жыл бұрын
Thanks for watching!
@dannorris14066 жыл бұрын
Another great tutorial Daniel. I love the coding side of the videos but I also feel that this is a fantastic way to teach some of the tougher concepts in mathematics. I know the maths in this was fairly straightforward but in other videos, you've covered some quite complex topics. In this visual, high energy format though, it's so easy to follow. Always lots of fun and great noises by the way...notably at 3:30 which is now my computer's error sound ;)
@zdddddd8 жыл бұрын
I watched only 1 video of this guy and when I saw this video I already knew he will say meatball as soon as video starts. and thats it he said :D
@RetsaGames3 жыл бұрын
These simple algorithms are so powerful it's insane. Can't wait to make some games with these noises
@albertolemosduran56852 жыл бұрын
Amazing video Daniel! You could also normalize the sum of the balls contribution by dividing by the total number of them, instead correcting the constant manually
@romywilliamson49818 жыл бұрын
This is so cool. I'm new to Processing and this was a really fun program to play around with.
@zinsy235 жыл бұрын
This video reminds me of the development of television. Started black and white and eventually got color!
@its_ya_guy_the_big_bak_guai7 жыл бұрын
Daniel!! When are you going to show us the 3D Metaballs??
@gdor113 жыл бұрын
i tried to multiply the color with the dot product of the velocity of the blob and the difference beetwen (x, y) and the blob's position and the results were REALY COOL
@gdor113 жыл бұрын
omg making variants of this i made my own abstract art o_o
@xnick_uy8 жыл бұрын
Pretty funny video. One thing I would like to try sometime is to merge the metaballs with the original frames from the camera instead of just replacing the pixels. Probably the pixel[index] should be set to some average value in HSV space.
@xnick_uy8 жыл бұрын
The one question I still have is how p5 handles all those divisions by zero that you pick up (whenever the distance is zero, that is).
@pianochess18826 жыл бұрын
In The sum variable you should divide by blobs.length. That way you don‘t need to adjust the scaling factor when you change the number of blobs
@BabaykaMoscow7 жыл бұрын
One of the best KZbin channels!
@lazerbeam97378 жыл бұрын
Loving your videos! Glad i came across your channel.
@TheCodingTrain8 жыл бұрын
i'm so glad to hear!
@MartinMllerSkarbiniksPedersen8 жыл бұрын
thanks for this video. I like your energi
@TheCodingTrain8 жыл бұрын
Thanks for watching!
@haruiz5 жыл бұрын
You are amazing !!! :D, I love these videos , this how teachers should teach to program
@petalaak7 жыл бұрын
Nice video, very helpful. I made metaballs visualization in JavaScript and while it does look nice, it runs very slow if you increase drawing area and number of blobs. I think that it slows down because it has to loop through every pixel and perform calculations per every pixel. Do you have any tips on how to optimize this so that it runs smooth on full screen with relatively high number of metaballs?
@SpringySpring043 жыл бұрын
I second this
@ShotgunLlama6 жыл бұрын
Metaballs metaballs, spaghetti underneath. Ravioli ravioli, great barrier reef!
@SpringySpring043 жыл бұрын
The otherworldly Italian creatures you ordered have been summoned
@softwave16628 жыл бұрын
I so love these videos.
@TheCodingTrain8 жыл бұрын
thank you!
@manuellehmann2676 жыл бұрын
Beware... Bad english incoming... :-D _Finally_ I understood, how this works. In the end it's not that complicated, than I thought. I'm working right now on a C++ version of it, using SFML. And... Yay, it works! Could you imagine, to do a 3D Version of it as a coding challenge? I'm pretty sure, it shouldn't be hard to port it to some kind of voxels. But how triangulate the meshes? :-/. Maybe there's a complete different way.... What I was going to say... I appreciate the way, how you share your knowledge with us and how you explain really everything in your slightly clumsy style (in a good way) .Had to laugh several times and learned so much from your videos. So... Thank you!
@marker526 жыл бұрын
Swear I saw a fidget spinner in the thumbnail...
@TheCodingTrain6 жыл бұрын
😂
@jrdnshw8 жыл бұрын
I love all of these tutorials and videos, I am learning so much - they are the best!!! I am trying to understand and wrap my head around how the sum of the blob radius / distance creates the gooey blob effect between each metaball. I took a look but didn't find anything specific on it, but was wondering if there is anywhere you can direct me that can explain the math behind it in further detail? Thanks!
@oonmm8 жыл бұрын
Look at around 11:10, he talks about it just before he adds more then one ball to the scene. Sorry that i can't give you a more specific time, i'm in a hurry.
@jamesmichaelmcdermot2 жыл бұрын
It's a combination of: 1 / distance has a "curved" effect, and our eyes tend to perceive borders between colours even though in reality they're in a spectrum.
@mrzerr22968 жыл бұрын
Is that normal that the same code in p5.js is really less performing (I suppose yes) ? How is it possible to make the p5 version as performing as the processing version ?
@2001herne4 жыл бұрын
It's completely normal. It simply isn't possible. The p5.js is written in javascript, which is run as interpreted code in the browser. The processing code is abstracted java code, and as such is compiled into java bytecode. To put it simply, the processing code is run closer to bare metal, with less overhead, so it's overall more performant. If Processing.org released a c++ version of their library it would most likely be even more performant. Another factor is that in the processing version you can change to the P2D or P3D renderer, which offloads some stuff onto the GPU. I'm not sure if you can do that with the p5js version.
@corrense8 жыл бұрын
Super and greats video that is helping me a lot in understanding the concepts. Cheers,
@TheCodingTrain8 жыл бұрын
Thanks so much!
@ferb11313 жыл бұрын
"This video is about coding metaballs! But first let me explain how pixels work in case anybody starting watching a coding challenge video without understanding what pixels are."
@kim157426 жыл бұрын
GLSL videos would be awesome!
@TheCodingTrain6 жыл бұрын
Someday I hope!
@SmokestormX8 жыл бұрын
Totally thought you were coding Meatballs.
@TheCodingTrain8 жыл бұрын
+Smokestorm almost!
@earthbjornnahkaimurrao95426 жыл бұрын
import GrandmasRecipes.js
@SpringySpring043 жыл бұрын
@@earthbjornnahkaimurrao9542 lmfao
@sarweshshah3 жыл бұрын
Hi +Daniel , thanks for the tutorial! :) I was wondering if the distance between the blob and the pixel iterator is 0 at some point and it leads to a division by 0 error. It does not happen here or in my code but is this something we need to take care of in the code?
@nagesh0072 жыл бұрын
Awesome
@thusharafernando44028 жыл бұрын
i read the title as MEATBALLS, i thought he was going to simulate meatballs.lol
@kuskus_th137 жыл бұрын
Thushara Fernando Well he might do it if he gets to computer gastronomy if that exists... Kappa
@FlextremeMusic8 жыл бұрын
Awesome videos and I love your enthusiasm! I was wondering how the sum works for the melting effect and why you don't divide by zero when the distance becomes zero when the pixel is at the origin of the blob. Hope to hear from you or anyone in the comments.
@jakoblenke30128 жыл бұрын
+Flextreme Production beep Did you heared something???
@darkfrei23 жыл бұрын
3:16 - wow! It's my avatar!
@Tentin.Quarantino5 жыл бұрын
*that* is one *spicy* metaball!
@rotten-Z4 жыл бұрын
Center of rectangle is ((maxx+minx)/2,(maxy+miny)/2)
@he2he3 жыл бұрын
(maxx + minx)/2 = minx + (maxx - minx) / 2
@rotten-Z3 жыл бұрын
@@he2he (max+min)/2 - two operations, your variant - 3
@he2he3 жыл бұрын
@@rotten-Z I just wanted to point out that the video wasn't wrong.
@rotten-Z3 жыл бұрын
@@he2he I didn’t say he was wrong. I just hinted that his formulas are not entirely optimal
@whomstareyou80137 жыл бұрын
After Binge Watching your Channel I am suddenly filled with DETERMINATION to learn JavaScript
@xclordon_46967 жыл бұрын
Arthur Jakubiec Java* not javascript
@whomstareyou80137 жыл бұрын
java and javascript work in similar ways, for me I find javascript easyer ro learn before going to full on Java
@SpringySpring043 жыл бұрын
Sand under the tail
@RexTorres6 жыл бұрын
Metaballs? Meatballs? Mothballs? Methballs?
@hamzabiyuzan69697 жыл бұрын
this is amaaaazing I really like ur videos thanks a lot
@TheCodingTrain7 жыл бұрын
thanks for watching!
@paulwright86954 жыл бұрын
I love these videos, but I'm finding it increasingly frustrating how you can Never draw the bottom line of a rectangle without sloping upwards!!!!!
@eyalmeltser42968 жыл бұрын
Really Cool!
@TheCodingTrain8 жыл бұрын
thanks!
@blackfamily23416 жыл бұрын
That's a spicy metabaaallll
@jekaterinajaroslavceva37226 жыл бұрын
Best chanel ever
@camsy832 жыл бұрын
If you had called the metaballs 'thisdots', that would truly have been meta
@luka657 жыл бұрын
How about combining this with a Particle Flowfield ?
@TheCodingTrain7 жыл бұрын
Great idea!
@orangutan94923 жыл бұрын
'I want to make a blob object' I think you mean blobject
@catapillie5 жыл бұрын
What if you divided the sum of the distances by the length of the blob list ? It might look interestingt, doesn't it? I wanna try it by myself 👀 Thanks for the amazing vid 👏
@DaddyDevit6 жыл бұрын
That's a one a spicy metaball
@blackbird12341008 жыл бұрын
now you have to code real meatballs. on another note, is there a place like the IRC or discord where you can help me? I have some questions about a program in p5js
@blackbird12341008 жыл бұрын
+Daniel Shiffman OK I will
@mephistosprincipium6 жыл бұрын
Today Mr. Spaghetti shows us how he codes his meatballs. ups, sorry wrong channel
@mickyr1716 жыл бұрын
This made me just convert from python mode to java mode lol, python modes for loops are super super slow and while its a little trickier to relearn java after using python mode for so long its totally worth the effort for the speed of the for loops in java mode :D
@mickyr1716 жыл бұрын
relearning java class objects will be tricky lol, python is so much easier to understand but once again, it will be worth it simply because of the speed of java
@SpringySpring043 жыл бұрын
_why would you use python mode!!_
@mickyr1712 жыл бұрын
@@SpringySpring04 because i was using python for years and it was easier
@SpringySpring042 жыл бұрын
@@mickyr171 I don't understand python even though it's so similar to Ruby which I understand a lot, and I also don't like python's syntax tbh
@mickyr1712 жыл бұрын
@@SpringySpring04 it was great but for loops are slow in it lol, processing is fantastic but also use c# in unity because it's even faster, recently created a vector flow field that can render 100K particles in processing at 60 fps using a different method to display, best I could do with using point() was about 12k at 60fps
@fernandojerez34448 жыл бұрын
Wow great job with those challenges. But just one question: Why always 51 for backgrounds!!!! i need a reason, curiosity it's killing me : )
@AnvitGarg257 жыл бұрын
someone recommended it to him in the first or second vid of the coding challenge
@Stufe22 жыл бұрын
Very cool tutorial! We made a drinking game. Everytime you grab your nose, we have to dring. now iam drunck
@mileswaugh7 жыл бұрын
you should make it so the meatballs bounce off each other
@abdlwahdsa8 жыл бұрын
Hey Daniel, love your channel. I wonder if there's a way to do this without having to deal with pixels. I'm doing this with HTML5 canvas and it's terribly slow (even after getting rid of sqrt's)
@kamoroso948 жыл бұрын
Yeah animating the canvas in JavaScript while changing the pixel data is always really slow. I'd be interested in seeing if there is a speedier solution though.
@TheCodingTrain8 жыл бұрын
i would like to eventually cover how to do this with shaders and/or geometry/vector shapes.
@khckwok6 жыл бұрын
hopefully that would be coming anytime soon!
@proloycodes2 жыл бұрын
i think youd want to use imageData instead of ctx.drawRectangle
@lethn29295 жыл бұрын
I know this is a long shot since this is a very old tutorial but is it possible to apply this effect to a 3D sphere primitive or an empty gameobject and have the metaballs follow these gameobjects?
@user-mw1qb5kd9l3 жыл бұрын
Afraid of saying meatballs, but methballs is fine for him...
@darkquaesar24606 жыл бұрын
Thats pretty meta.
@xanderlewis8 жыл бұрын
You're my favourite. :)
@LorenzoLeonardini8 жыл бұрын
where can I suggest a coding challenge?
@TheCodingTrain8 жыл бұрын
github.com/CodingRainbow/Rainbow-Topics/issues
@LorenzoLeonardini8 жыл бұрын
Daniel Shiffman thanks
@renjithkumar69518 жыл бұрын
Sir, Can you please make a tutorial on 2d water surface simulation based on Hugo Elias algorithm in a layman language. Thanks for your quality lessons.
@innokentiyromanchenko14503 жыл бұрын
amazing speaking rainbow
@RSPikachuAlpha8 жыл бұрын
I luv meatballs
@zechn18197 жыл бұрын
Thanks for your video. When I tried to run this on Android Device, it became too slow(1 frame / 2 sec). but it runs very well on PC or laptop.. Do you know why?
@luissolis79737 жыл бұрын
Did you finally release a p5 version of this?
@robertobreve86236 жыл бұрын
I think I love you
@ryderpham54648 жыл бұрын
I'm going to be a grammar nazi and say that it's RADII, not radiuses at 7:07.
@TheCodingTrain8 жыл бұрын
+trien pham oh. Good point!
@ryderpham54648 жыл бұрын
Or do you mean, good "both the x and the y coordinates combined"
@mikeynjs948 жыл бұрын
Either are correct. Radii is the traditional, Latin plural, radiuses is the lax, English plural.
@ryderpham54648 жыл бұрын
English is weird, so i say radii. i also say octopi, not octopuses
@nhobb8 жыл бұрын
it's octopodes not octopi
@Tirwrai8 жыл бұрын
Hello Where can I download a video to your program source code, talking about great
@rockyrivermushrooms5298 жыл бұрын
Ravioli Ravioli, quickly code the metaballioli
@kranser7 жыл бұрын
background(51); just gives me a grey screen and nothing shows until I comment that line out - what am I doing wrong?
@Vedvart18 жыл бұрын
In p5js, this is VERY laggy, possibly because one must loop over each pixel rather than a pixel group... anybody have any solutions or help?
@wallacesantos06 жыл бұрын
I don't know if is possible to solve this problem because of the nature of JavaScript. I hope I'm not talking any sh**, but is a higher lvl language than Java, and so, Java is faster.
@socketbyte53486 жыл бұрын
It would be like 4852745284x faster if it was done as a shader (executed by GPU)
@Xnoob5455 жыл бұрын
I laughed so hard at 11:00
@atrumluminarium6 жыл бұрын
Blob object? You mean Blobject? :P
@iambugking7 жыл бұрын
Disappointed you didn't say blobject.
@BDYH-ey8kd8 жыл бұрын
made it seem so effortless, with that amounth of skill i probally takes no more effort at all ..
@TheCodingTrain8 жыл бұрын
thanks!
@BDYH-ey8kd8 жыл бұрын
Daniel Shiffman Dan, khan academy is looking for a new video star.. it should be u! ('khan academy talent search' open till Agust 1.)
@TheCodingTrain8 жыл бұрын
Yeah, I was thinking about that. But can't settle on a topic to do. Any ideas? Also, I'm happy just doing stuff for my own channel.
@BDYH-ey8kd8 жыл бұрын
Havn't, seen all your stuff, but personally i would like to see u do more with the circles, maybe swarm decentralized, (ad hoc) random generated communication-messages for simulating drones/networks? with limited bandwidth and other constraints. Maybe include also latency, propation (as expanding circles?), for stabalizing force/distance-field with wind-influence.. changing colours when active in communication/routing, random failure-rates? stuff like that with meaning full messages. like a series based on that where u then can go in futher in pro/cons of different messaging types/protocols related to ad-hoc, simulate the system and even more complex factors like multiple random messages in the network.. just my 2 cents (>^____^
@jakeniemiec85598 жыл бұрын
random2D does not work for my version of processing. any suggestions on ways I can make it move
@3ab8aR8 жыл бұрын
could you please make some polygon collision detection videos like the one in unity3d and how you make the polygon around the image (detect image edges) :D thanks in advance even if you won't do them :V
Why i can't use b as the index of the blob? why is index[0]? i want to draw them with the mouse...
@Awss-qy9dk5 жыл бұрын
One day, I MET A BALL
@JordanShackelford7 жыл бұрын
spaghetti and metaballs
@zobook2 жыл бұрын
I understand now why de "Code of conduct" is first and foremost about gender al LGBT stuff. The "queerness" of the channel increased over the years, in a linear function way. Fortunately, the overall quality has increased exponentially so no complains here. 😊
@zobook2 жыл бұрын
@PERSEUS 93 I don't think so but that's ok
@sandortakacs5468 жыл бұрын
In HTML pure javascript canvas I get colors in the middle of my blobs, like you did when you made sum % 255. How can I remove those colors from the blobs?
@TheCodingTrain8 жыл бұрын
+Sándor Takács cap the sum value at 255 using an if statement or constrain() if you are using p5.
@sandortakacs5468 жыл бұрын
Thanks, it worked. I don't use p5.js, but I wrote my constrain function.
@scanerang7 жыл бұрын
I tried to do this... had 1 fps on my gaming pc, but I drew each point one at a time tho
@spicybaguette77066 жыл бұрын
They should rename colorMode HSB to colorMode LSD
@stefanpopa66687 жыл бұрын
Hi all! Does anyone know how I could load this animation created in Processing as an animated Desktop background?
@xclordon_46967 жыл бұрын
Andrei Popa no
@cjvman7 жыл бұрын
Andrei Popa, Windows used to allow HTML files to be background pictures, so you could remake it in JavaScript maybe?
@MatthiasKrijgsman8 жыл бұрын
13:58 xD
@mircoheitmann8 жыл бұрын
Have you never experienced bluhuhhblujhuluhuhu-Colored Things in the Center?
@lmeonliver18644 жыл бұрын
Ryz yes
@PrimusProductions6 жыл бұрын
13:51 Fidget Spinners
@borekworek696 жыл бұрын
no.
@thesdfable3 жыл бұрын
hello! how do I change the color of the distance. I mean how do I make the blobs darker?
@thesdfable3 жыл бұрын
Actually how do I pick specific colors but not anything RGB