r/generative • • Mar 26 '22

Metaball Interactions

1.4k Upvotes

24 comments sorted by

9

u/robobachelor Mar 27 '22

Really good. Can you talk about how you did it?

47

u/h7k2a4 Mar 27 '22

I first generate a 3D scalar field from the contributions of several metaball functions. Then I sample the field at fixed y axis intervals and use the marching squares algorithm to construct 2D shape outlines on the xz plane at each y location. Then I rotate everything about the X axis to give some more perspective. Each metaball is initialized with a random position and velocity direction to generate the animation and correcting acceleration is applied when things go to far from the center. The texture is added by post processing the rendered 2D frames using noise and applying a paper gradient.

5

u/DefinitelyChad Mar 27 '22

What software do you do this in?

20

u/h7k2a4 Mar 27 '22

I did the base animation with Java in the Processing environment and post processing with Python

4

u/outsidEverything Mar 27 '22

So the grain texture was added in postprocessing? And may I ask, why Python?

5

u/h7k2a4 Mar 27 '22

Yeah I just generated the video frames with Processing and used Python to add the texture and construct the video. I have a lot of experience doing image processing with Python and it allowed me to do a lot of experimentation and change things quickly. I chose Processing in the first place because I am comfortable with it and it provides a 3D environment and graphics library.

3

u/MCWizardYT Mar 27 '22

It's probably the language they are most comfortable in.

For me, that's java.

You can do almost anything in most modern languages so the ones you pick don't really matter.

Unless you are going to do something like develop firmware/an operating system or do a very specific task where really only one language applies (like HTML for web frontend)

1

u/[deleted] Mar 27 '22

Languages do matter when it comes to real-time graphics.

C++ and HLSL are practically mandatory unless you're using an API that compiles down to those languages.

7

u/mitch3x3 Mar 27 '22

I’d love to see the code if you feel comfortable sharing. Feel free to DM me

61

u/kuttymongoose Mar 27 '22

Now do meatball interactions.

12

u/[deleted] Mar 27 '22

That's what I read in the first place

20

u/[deleted] Mar 26 '22

Cool! I like the ink on paper style, too.

4

u/rydavo Mar 27 '22

My mind went straight to boobs and I love this.

4

u/dustypandayt Mar 27 '22

0:11 boobas

1

u/genart_studio Artist Mar 27 '22

Wonderful! How did you go about making the paper-like background?

2

u/h7k2a4 Mar 27 '22

For the background I just found a picture of paper than applied a sobel filter and added that to a uniform base color. The processing on the moving part is done with bias noise which is a cool technique I’ve seen quite a bit on this sub lately

1

u/RedPenguin_YT Apr 27 '22

what did you make this in

1

u/h7k2a4 Apr 27 '22

Base animation with Processing, texturing effects with Python

3

u/flapsnacc Mar 27 '22

very nice texture!

2

u/moko46 Mar 27 '22

Beautiful!

1

u/dexhaus Mar 27 '22

This is absolutely amazing! Fantastic job!

1

u/heckingcomputernerd Mar 27 '22

Woah not sure I’ve seen 3d meta balls before

Coollll

1

u/ndilegid Mar 27 '22

Golgi Apparatus!

1

u/[deleted] Mar 27 '22

Wow never seen anything like it! Pretty