# Bubbles

## Recommended Posts

Hello,

I've been trying to figure out how to simulate the behavior of bubbles when they come in contact with each other.

When bubbles come in contact, the surface of the sphere flattens out at an angle perpendicular to a line connecting the centroids/centers of the two spheres. Any thoughts on how to set something like that up?

I would think you could start by testing for the length between the centers of the spheres, and if the distance between the centers becomes less than the sum of their radii, the surfaces would begin to flatten where they contact. I would think deforming the surface by scaling down the magnitude of the surface normals would work, but I don't know how to deform an object this way. I'm still a novice as far as building tools like this goes, so please forgive my lack of understanding. Any hints or suggestions would be greatly appreciated.

Thanks,

Steve

##### Share on other sites

There was an interesting technical paper regarding bubble creation by Pixar and Dreamworks presented at last Siggraph 2013

##### Share on other sites

There was an interesting technical paper regarding bubble creation by Pixar and Dreamworks presented at last Siggraph 2013

Is there a chance you got your own implementation of it? Could you share it?

##### Share on other sites

never tried but on siggraph their presentation was more artistic than deep mathematical implementation

##### Share on other sites

Maybe using cloth and collide/stick when they contact?

Does the picture below reference to what you're looking for? I just need to get the idea

Edited by amination
##### Share on other sites

Just something simple with Cookies, it might give you a starting point. I tried creating the inner "wall" with a polycap, but that doesn't turn out so well. Also it might be a lot slower than something created in vops, but its just a quick idea this early morning.

bubbletry_dv.hipnc

##### Share on other sites

Maybe with displacement, point clouds and a little bit of math??

##### Share on other sites

Thank you for the replies! I saw a demonstration by Todd Akita of this done with ICE in XSI, and have wanted to figure out how to make it work in Houdini. His presentation notes are here if you're curious (http://area.autodesk.com/blogs/marks/todd-akitas-ice-design-tools-document).

It was was an example of what can be done through basic normal manipulation. Sort of like metaballs, except instead of pulling together the surfaces flatten out, when two spheres move into contact with each other. I'm just looking for a place to start.

@animation, that's it exactly.

@Skybar, thanks for the scene example. That's the correct end result, for some reason the caps aren't coming across when I look at it. Can this still work if the spheres move around? Or do they need to stay in one place?

@Mzigaid, you're absolutely correct

##### Share on other sites

@Skybar, thanks for the scene example. That's the correct end result, for some reason the caps aren't coming across when I look at it. Can this still work if the spheres move around? Or do they need to stay in one place?

Yeah I disabled the polycaps since the polys created doesn't really work, but I don't really know how you can fill holes like that otherwise so I figured putting the points in a group might open up for something else. And yeah it works if you move the spheres, it isn't very fast though because of the cookies (booleans).

##### Share on other sites

Thanks Dude!

Now I just need the math talent to understand and apply this!

Edited by Mzigaib
##### Share on other sites

Thanks Ian, those are great. The second paper is a bit more accessible.

##### Share on other sites

No prob. Those papers were referenced on Partysaurus, btw.

##### Share on other sites

i wish i could understand those maths too

##### Share on other sites

This is my first attempt at this. The attached scene file is somewhat hacked togehter. Feel free to improve it.

To get the bubbles in the initial positions, three equations need to be turned into expressions (This is all from the second paper, by Andrew Glassner, that Ian provided earlier.):

1. 1/rC=1/rB-1/rA (r = radius of spheres). This will keep the relative sphere sizes correct. There are three spheres, two that are visible and one larger one "C", that forms the inner wall of the bubble.

2. distance AB=sqrt((rA^2+rB^2)-(rA*rB)). This is distance between the centers of spheres A and B.

3. distance AC=sqrt((rA^2+rC^2)+(rA*rC)). This is the distance between spheres A and C. Sphere C is at world center.

I used the "surfsect" node to do the booleans. I was trying to use metaballs, but just couldn't quite get them to work right.

The shader is built into Houdini, the "thin film" material. I don't know enough about making shaders at this point to add in refraction. If anyone could offer tips on how to do it, it would be appreciated. The backgrounds are just some different HDRI images put into the environment light.

These are also just two spheres, but it's the starting point to do larger groups. The paper noted above explains how to add more.

Thanks for all the help!

Bubbles_v1.4.hipnc

## Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

×   Pasted as rich text.   Paste as plain text instead

Only 75 emoji are allowed.

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×