Remember 3December
Find out where to celebrate your 3D CG art...
Theme color:
  • 1/3
You are here: Homepage /  Blogs /  Duncan's Blog / Bubble Level with nCloth
Bubble Level with nCloth
Posted: May 13, 2008
Category: nCloth
Social Media:
Bookmark and Share
It has been a long while since I've been active on this blog. I've been very busy lately doing product development.

Here is a simple tutorial that shows how to implement a bubble style carpenter's level with nCloth.
1. Create a simple cylinder for the glass tube and a sphere for the bubble. In order to get nice uniform quads start with a poly cube and do "Mesh: Smooth" with a divisionLevel of 3 to make it into a sphere. This will simulate better than the default sphere.
2. Make the sphere an nCloth and make the cylinder a passive collider. Turn off trapped check on the nRigid node for the cylinder, because trapped check assumes we are colliding on the outside of the object( or one could reverse normals on the cylinder ).

3. Set the gravity to -100 on the nucleus node. This will make the bubble rise quickly. Also make the substeps 9 and the maxCollisionIterations 17 for better collision quality. The bubble will now rise, but will collapse like a plastic bag.
4. Set the nCloth pressure method to "Volume Tracking Model". The cloth should now behave like a bubble. You can increase the startPressure if desired(this basically means that the air inside the initial sphere is pressurized). This will tend to keep the bubble more spherical. If you use a low value for the startPressure allowing the drop to deform more, then it may buckle or overlap in places. To deal with this one can set the self collision flag to "Vertex" and increase the self collide width scale until the vertices just touch. (set solverDisplay to "self collision" to preview)

5. Increase drag to keep the bubble from bouncing too much. Optionally one may also wish to increase damp. If the bubble does not slide enough then you may wish to lower friction on the tube and/or bubble.
In order to post any comments, you must be logged in!
Newest users comments View All 9 Comments
Posted by Duncan Brinsmead on Sep 08, 2008 at 11:43 PM
Yes, it would be pretty trivial to do with nParticles.

Duncan
Posted by Max Balboa on Sep 06, 2008 at 12:51 PM
I think splitting the bubble can now be achieved in maya 2009s' nParticle Module. What do you think? :)
Posted by blade33ru on Jun 19, 2008 at 12:04 AM
hey no more tutorials ...focus on product dev ;)
Posted by strob on Jun 03, 2008 at 09:10 PM
Hi Duncan!

I can't wait to see what product developement you did! Thanks a lot for those tuts!

jocelyn "Strob" Simard, Montreal.
Posted by sacslacker on May 14, 2008 at 12:23 AM
Thanks for taking some time to show us more neat tricks!

Can't wait to see what the new development brings us!