We closed this forum 18 June 2010. It has served us well since 2005 as the ALPHA forum did before it from 2002 to 2005. New discussions are ongoing at the new URL http://forum.processing.org. You'll need to sign up and get a new user account. We're sorry about that inconvenience, but we think it's better in the long run. The content on this forum will remain online.
IndexProgramming Questions & HelpOther Libraries › Toxiclibs question
Page Index Toggle Pages: 1
Toxiclibs question (Read 1198 times)
Toxiclibs question
Jan 7th, 2010, 5:29pm
 
Hi all, new to the forum but been lurking and hacking my way through Processing for a little while.

Toxiclibs look pretty good for a particular piece that I am working on.  But, as other posters on this board have mentioned, either the demo code is absent or fairly complex, and hard to dig though if you're not familiar with it.

Does anyone know of public code that demonstrates toxiclibs with 2D spline objects colliding with each other, sort of like that Nokia Friends animation recently posted?

Many thanks.
Re: Toxiclibs question
Reply #1 - Jan 8th, 2010, 9:33am
 
Hey, sorry for the late reply (also to your email)... colliding deformable, spline based softbodies is not exactly the easiest exercise, especially if you're already thinking the given examples are too hard to get into/understand. The next release of verletphysics will have some utilities to help with the shape creation parts of that (i.e. the ParticlePath & ParticleString classes), but the collision detection & resolution would still be down to you.

The approach I've taken for Nokia Friends was to connect all vertices of each blob with each other in order to form a separate entity/group of related particles. Then each frame check each particle's distance to all other blobs (i.e. their particles) and if it's less than a threshold distance (e.g. 10 pixels) create a temporary spring between that closest particle of that other blob and the currently checked one... this spring would only remain alive as long as the 2 particles are still too close to each other and then be removed again. You can also watch this behaviour in the video below... The short cyan lines are these temporary springs keeping all blobs away from each other.

http://www.vimeo.com/702576
Re: Toxiclibs question
Reply #2 - Jan 8th, 2010, 10:25am
 
No problem for the "lateness"  Wink  Thanks for the reply.

I have started to muck around more with splines, and have started forming ideas for the approaches I could take for collision detection.  Glad to see that my concept was not far from yours -- I too saw that each vertice had to do its own check, and that with each neighbor, I would have to check with each of their vertices....  The idea of making a temp spring sounds pretty good, and I will probably be sending some more questions later.
Re: Toxiclibs question
Reply #3 - Jan 8th, 2010, 8:57pm
 
Sorry to double post.  But, I just finished up working out acceptable mechanics for the colliding softbodies.  No, it isn't fit for Audi engineers or medical device design, but it will be fine for my app, or anyone who is making games or illustrative sort of work.

So there.
Smiley

Not only that, but I have commented them up, from just using a Spline2D object, all the way to a multi-object array of blobs that squich up when they hit each other.  And the whole 5 part "tutorial" series is available to you, Toxi, to post on your site, if you feel they aren't too n00by for you.   Roll Eyes  You may not want to be associated with them.

One more thing, T. When the "tightness" on a Spline2D is increased, the curve gets zig-zaggy in an ugly way.

Can you send some instructions to fix that problem?  I'd like a smoother line.

Could you provide the code that made that Verlet collision demo?

Thanks.  In all seriousness, even the little sliver of your libs that I am using will make a huge improvement to my project.  You did a lot of great work.
Page Index Toggle Pages: 1