View Full Version : Magnet Deformation
03 March 2004, 11:24 PM
Does anyone have any information on Magnet type deformation used with Bones?
Thanks for any help,
03 March 2004, 11:38 AM
What exactly are you wanting to do? I bone-driven deformation? Or a "magnet" deformation in conjunction with a bone-driven deformation?
03 March 2004, 04:52 PM
A bone driven deformation based on Magnets.
03 March 2004, 05:14 PM
Oop, perhaps I should have specified better... what exactly do you mean by a magnet? I'm having a hard time picturing what it is you want to do?
03 March 2004, 05:17 AM
Hmm. I guess that's actually a really good question. Before It seemed clearer in my head but now that I think about it, I don't really know what the difference is. Anyway, What I'm thinking of is the difference between how bones work in LightWave and Messiah and how they work in Maya and Max. In LightWave/Messiah, bones are just added to a mesh and the closest points become influenced by it. You have properties to change the influence range and falloff and stuff like that. In Maya/Max, You start out like this but then have to edit the points associated with a bone by way of a weight map. You can do the same thing in LightWave but sometimes it's nice to just stick some bones in and have them work right off the bat.
So, the LightWave/Messiah way is done using a method that I've heard called Magnets. This is very similar to the magnet tools found in some modeling programs (also called soft selection).
So, other then that, That's all I know. Sorry, I was hoping someone else would know more so I could ask some questions of at least find some info on the net.
03 March 2004, 02:34 PM
I've not seen any reference on this either, though game dev sites are usually a good place to use for "simple" things like this.
A naive implementation might go something like:
for each vertex in mesh
for each bone in skeleton
l = lineBetween( bone, nextbone )
d = perpendicularDistance( fromVertex, toBone)
i = linstep( influence + falloff, influence, d )
addInfluence( vertex, pow(i, falloffpower) )
03 March 2004, 01:03 AM
Try this plugin of mine. New version 0.5, just hot off the press:
Install it and read the README.txt. Particularly the sections about weightCube, etc. Those will add the functionality you seek to maya (and much more :).
As playmesumch00ns said, there's not much to it.
03 March 2004, 08:26 AM
Yeah that's really neat. But... Ahhh... Well, I don't mean to seem ungrateful but I'm actually looking for information on programming magnet deformation systems... I'm not really looking for a plug in to manipulate weights in Maya. I'm trying to make one for a program that I'm personally writing.
03 March 2004, 10:05 AM
Originally posted by ngrava
I'm actually looking for information on programming magnet deformation systems...
You DO realize that playmesumch00ns's previous message already gave you the algorithm you need to get started, right? Well, I don't agree much with the linstep() portion of it, but other than that, it seems clear to me.
Did you understand his answer and pseudo code?
The algorithm for a basic capsule enveloping is just that simple. Coding it in C or what-have-you will require more code, but the algorithm does not change.
See www.magic-software.com or similar if you are not familiar how to calculate distances between a point and a line.
See Jeff Lander's web site for a basic barebones weighting tool, with source code. You can then add automatic weighting to it, easily.
03 March 2004, 02:22 PM
03 March 2004, 02:25 PM
sorry this is correct.
01 January 2006, 03:00 PM
This thread has been automatically closed as it remained inactive for 12 months. If you wish to continue the discussion, please create a new thread in the appropriate forum.