How Computers Draw Weird Shapes (Marching Squares)

How Computers Draw Weird Shapes (Marching Squares)

Reducible

2 года назад

411,197 Просмотров

Ссылки и html тэги не поддерживаются


Комментарии:

@Veptis
@Veptis - 04.05.2022 02:05

Your intro made we wonder about how keyframes can be interpolated for vectors or matrixes of values instead of just numbers.
I have been wondering about it with some video transitions like smoothcut or morphing. Which seem to be related?

Ответить
@volbla
@volbla - 10.05.2022 15:33

The moral at the end makes me think of Vi Hart's videos on logarithms.

Ответить
@angeldude101
@angeldude101 - 12.05.2022 08:12

After looking at metaballs for a while, they seem to be much more general than just circles. It seems they can be generated with any kind of level curve. of the form f(v ⃗) = ±1, with curves usually defined as f(v ⃗) = r being transformed to r/f(v ⃗). f in this case doesn't need to be a circle. It doesn't even need to be an ellipse. It doesn't even need to be closed. Similarly, r doesn't have to be positive. It can also be negative, which makes that "negaball" "eat away" at the other metaballs.

Ответить
@Saavik256
@Saavik256 - 20.05.2022 02:58

Great video, but I had a really hard time telling the green and blue dots apart. Maybe use more contrasting colours next time ?

Ответить
@yuvaldahan642
@yuvaldahan642 - 23.05.2022 06:12

Can there be a case where the implicit function has asymptotes?
Which would mean two corners are above and below one without crossing one in between

Ответить
@omicron1100
@omicron1100 - 26.05.2022 10:20

Oh man you have no idea how long it took for me to re-find this video

Ответить
@theodoredreiser9743
@theodoredreiser9743 - 02.06.2022 16:03

О, сегодня видел эту статью на хабре

Ответить
@CrushedAsian255
@CrushedAsian255 - 29.06.2022 04:41

Thanks so much for making this video! This encouraged me to try making my own metaball renderer using marching squares, which I completed. It works well but did take like ~3 days to write. (mostly bug fixing the marching squares)

Ответить
@umedina98
@umedina98 - 11.07.2022 15:25

This video is amazing! Thanks!

Ответить
@oriyonay8825
@oriyonay8825 - 15.07.2022 08:54

i love this video!
an idea i had while watching it would be to keep a queue of all squares that the contour passes through the contour. then we could iteratively divide each square in the queue into four smaller squares and perform the same root-finding algorithm on them to further refine the quality of our contour, and push those four squares back onto the queue. we discard squares from the queue once they reach a certain size (i.e., once they're small enough).

i wonder if anyone's done that!

Ответить
@vardhanr8177
@vardhanr8177 - 27.07.2022 13:22

Another way to generate something that is close to metaballs is… the locus of a point whose product of the distances from two given points is a constant. So if the given points are (x_1, y_1) and (x_2, y_2) and the constant product is "a", then the inplicit equation would be √((x - x_1) ^ 2 + (y - y_1) ^ 2) * √((x - x_2) ^ 2 + (y - y_2) ^ 2) = a. Also, this locus is a toric section.

Ответить
@wingdinggaster6737
@wingdinggaster6737 - 01.08.2022 10:26

in the space sampling, you can also do diagonal root finding to get a bit more accuracy

Ответить
@daflamingfox
@daflamingfox - 02.08.2022 03:24

My man is 3blue1brown of CS :)

Ответить
@skeletonboxers7336
@skeletonboxers7336 - 02.08.2022 13:43

computer graphics was one of the classes that just never lined up during my time in university. so ive been spending my time since graduation learning concepts of things i missed out on (and job hunting as well lol) and this has to be one of my favorite concepts to be self teaching. i heard the class was hell, and i guess im glad in a way to be learning it through more digestible and paced content from creators like you.

Ответить
@nanamacapagal8342
@nanamacapagal8342 - 04.08.2022 05:44

The way you rediscovered this topic of metaballs is actually pretty relatable. I've learned much more in pretty much any topic (mostly computer science) by simply playing around, looking into things, solving problems, and creating projects, than by taking a course.

Ответить
@ko-prometheus
@ko-prometheus - 06.08.2022 01:24

Hi,
What did you apply? What 3D software??
Mayaa, 3B Max ....??

Ответить
@pineapplesandwich3906
@pineapplesandwich3906 - 08.08.2022 18:21

While watching the video I had to check if the channel was 3blue1brown, absolutely amazing.

Ответить
@tererenji
@tererenji - 10.08.2022 12:29

You can use complex polynomials!
Imagine you want to make n of these circles in an m by m grid. You can define each center with a complex number x+yi, and then define the polynomial
f(z) = (z-c_0)*(z-c_1)....(z-c_n) with c denoting the centers. now, you can plot the absolute value, more and less than some values to give you circles. now, by moving each center, you have an animated version; no need for any implicit circle and/or ellipse formula!

Ответить
@somniad
@somniad - 13.08.2022 15:06

I actually guessed at the beginning that you just sum the reciprocal distances and then define some sort of cutoff point - the observation that led me there had nothing to do with electricity, though. It looked like it might be how two large bodies of fluid would interact gravitationally, and I guessed that inverse square isn't necessary to make this look roughly right, just inverse. My algorithm for drawing it probably would have looked right, but it would have been so much less efficient!

Ответить
@tonykarp5981
@tonykarp5981 - 14.08.2022 20:11

could someone please give the specific algorithm to generate this color palette (green on the left and blue on the right)

Ответить
@ChrisOffner
@ChrisOffner - 22.08.2022 15:09

Absolutely beautiful explanation and presentation! Thank you so much. ❤️

Ответить
@wendolinmendoza517
@wendolinmendoza517 - 06.09.2022 10:36

Awesome video. Definitely going to try it out in Processing

Ответить
@alhdlakhfdqw
@alhdlakhfdqw - 30.10.2022 19:10

really amazing video thank you very much! :) subbed already

Ответить
@thedebapriyakar
@thedebapriyakar - 05.11.2022 08:59

I absolutely fucking love your energy, Reducible. Love your videos. I really wanted to know how you would approach the study of computer graphics if you were given the chance to start out again?!

Ответить
@OhItsCalvin
@OhItsCalvin - 15.11.2022 20:13

amazing video. I can't even explain how inspiring your channel is to me! It would be nice if you would make a video that documents your process for making videos

Ответить
@PunnamarajVinayakTejas
@PunnamarajVinayakTejas - 04.12.2022 09:17

AHA I thought about equipotential contours in a gravitational potential immediately!

Ответить
@johncolt3582
@johncolt3582 - 14.01.2023 01:40

Five seconds into the video I'm like: draw black circles -> gausian blurr -> binarise/treshold -> find edges

Ответить
@dzhimy6266
@dzhimy6266 - 20.01.2023 16:46

lerp

Ответить
@PGETSA17
@PGETSA17 - 02.02.2023 16:58

I really really love this video, and now I understand a lot of new things. When you introduced the problem, I had the same 3 questions that you proposed! Thank you, great video.

Ответить
@acm1812
@acm1812 - 06.02.2023 01:47

goated video

Ответить
@commandcracker8635
@commandcracker8635 - 06.02.2023 12:11

You’ve gained a sub.

Ответить
@insanitycubed8832
@insanitycubed8832 - 08.02.2023 09:24

I used to mess with stuff like this on desmos when I was bored in math class. I just added 2 definitions of a circle in varying ways until it started to look cool. Not sure if they were actual metaballs by definition or not, but they did look pretty similar.

Ответить
@m44-k2q
@m44-k2q - 08.02.2023 22:00

One of the clearest explanation i saw , Hats off man.

Ответить
@vincentcleaver1925
@vincentcleaver1925 - 23.02.2023 02:29

We could always subdivide the squares into triangle pairs... then subdivide the triangle into a quad and a triangle, each of which is totally inside or outside the contour line.
Or only draw the contour line, I guess...

Ответить
@nameno7032
@nameno7032 - 26.03.2023 22:58

What a beautiful explaination on the topic. Thank you so much, subscribe so fast tho
So I have a question the other way, with the contour of a shape, how do we approximately get the implicit function of that shape?

Ответить
@SimplexonYt
@SimplexonYt - 15.09.2023 09:36

just use the 3D Funktion 1/(((x-x_A)^2)+((y-y_A)^2)) (x_A and y_A are the coordinates of the metablall) and project only the part that is equal to 1

Ответить
@swag_designs5470
@swag_designs5470 - 27.10.2023 19:29

Thank you

Ответить
@newklear2k
@newklear2k - 03.11.2023 08:54

Metaballs sounds like how an old Italian grocer would say meatballs.

Ответить
@ax23w4
@ax23w4 - 23.12.2023 13:18

Finally I understand the concept behind marching squares. Still don't get the metaball math though. Or any math at all for that reason :(

Ответить
@nightchicken3517
@nightchicken3517 - 13.08.2024 06:52

Ive been working on a lava lamp sim, this might come in handy

Ответить
@little-ork
@little-ork - 21.08.2024 15:26

the answer is: just draw a bunch of sdf, then apply smooth min and draw only pixels whose values are close to zero

Ответить
@pigizoid9924
@pigizoid9924 - 31.08.2024 13:24

As a programmer i would have just had each circle have another circle surrounding it, any circle within the outer circle radius will change the inner circles shape based on distance, and each inner shape can be a set of lines

this would also work with any other shape, and increasing the line count increases the shape quality

Ответить
@MooImABunny
@MooImABunny - 02.09.2024 04:00

That's cool and all, but wait till you'll see the matching truncated octahedron!

Ответить