|
Author |
Topic: Soda-like Animal (Read 2030 times) |
|
v3ga
|
Soda-like Animal
« on: Feb 28th, 2003, 1:03am » |
|
Hello, I've programmed a kind of object which behaves like one picked up from SodaZoo. The example can be viewed at http://v3ga.free.fr/Java/SodaTry/ , source code is located at http://v3ga.free.fr/Java/SodaTry/SodaTry_sourceCode.htm The code implements a particle system with contraints which is updated along time thanks to Verlet integrator. Some objects were designed, but only one is currently displayed. You can drag the object by picking up a particle, be careful
|
http://v3ga.net
|
|
|
tomek
|
Re: Soda-like Animal
« Reply #1 on: Feb 28th, 2003, 1:33am » |
|
Neat. I also looked around your site and I would love some hints on how the 'liquid balls' applet was designed. I am interested in the algorithm/description not the source code... Would you like to elaborate? Or maybe a pointer where I can learn about this kind of liquid simulation?
|
|
|
|
v3ga
|
Re: Soda-like Animal
« Reply #2 on: Feb 28th, 2003, 2:02am » |
|
Thank you. The liquid balls could also be called 'metaballs', and are based on an algorythm called 'marching cubes'. The basic principle behind the applet is to represent an isosurface. Each Blob is in fact a circle (just try viscosity=1), which is associated with a scalar function ( typically 1/(r*r) , r being the distance from the center of a ball to a space point). Take a grid in space, and for each node of the grid, calculate the contribution at that point of all the balls. It gives you a grid of (iso)values. All you have to do is to arbitrary choose a fixed isovalue and draw the curve which joins the points of the grid (using 'marching cubes') Hmm didn't know if my explanation is that clear. Anyway, here are some useful links : http://www.angelcode.com/articles/metaballs/metaballs.asp http://www.siggraph.org/education/materials/HyperVis/vistech/volume/surf ace4.htm http://www.exaflop.org/docs/marchcubes/ind.html
|
http://v3ga.net
|
|
|
tomek
|
Re: Soda-like Animal
« Reply #3 on: Feb 28th, 2003, 2:25am » |
|
Excellent. This is the kind of 'starter info' I was counting on - I will go and explore... Cheers!
|
|
|
|
Ariel Malka Guest
|
Re: Soda-like Animal
« Reply #4 on: Mar 2nd, 2003, 10:31pm » |
|
salut v3ga, i liked very much your soda-like-animal... actually, i'm interested in coding-examples using verlet integration but it seems that the source code you provided is uncomplete: for example, i'm "dying" to see how you implemented "satifsyConstraints()", but it's not there... is it possible to see the full code? thanks!
|
|
|
|
v3ga
|
Re: Soda-like Animal
« Reply #5 on: Mar 2nd, 2003, 11:10pm » |
|
Ah yes ! I've been looking at the page, and it seems there are problems wih <pre> tags which has eaten some of the code lines. Anyway, just view the source of the html page, the full listing is inside. My code is based on : http://www.ioi.dk/Homepages/thomasj/publications/gdc2001.htm This is a very good tutorial on verlet integration and its application.
|
http://v3ga.net
|
|
|
arielm
|
Re: Soda-like Animal
« Reply #6 on: Mar 2nd, 2003, 11:57pm » |
|
a 4th order runge-kutta thanks! i know the tutorial you mentioned (i think it's going to be a "classical" reading for people that play with rigid body stuff) please let us know when you make your next proce55ing-physics-oriented sketch... a
|
Ariel Malka | www.chronotext.org
|
|
|
|