Spring Model
Hi,
I have 2D simulation where I have a number of objects (three for test purposes) with each object connected to its neighbour by a spring.
The spring model has an inertial-length attribute, with spring extension/compression yeilding positive or negative forces on the connecting weights.
I also include a gravity acceleration when caculating forces.
This all works fine, but I want to model the spring as a vector to increase the stability of the model.
If I create a box using four weights with four spring connections, I want to be able to keep one vertex static (like an anchor) with the whole model reacting so that the center of gravity of the model moves to its correct position.
I can get it working by (awkwardly) calculating the angular velocities about the anchor vertex, but this leads to problems with recursion and isn''t very elegant.
Has anyone any ideas?
Thanks.
<a href="http://www.purplenose.com>purplenose.com
I would think that setting the mass of the anchor vertex to infinity would do the trick.
This would cause the term (1 / mass) to be zero and therefore that vertex would not move.
You may just want to do that for the spring so that the vertex can still move with gravity, but not from spring forces.
Hope this helps.
lusinho
hi, thanks for the reply.
The problem isn't keeping the anchor vertex steady (I just initialise the currently selected weight to zero gravitational pull).
The problem is when that vertex is selected (and so no gravity affecting it so it doesn't drop), I want the other vertices to swing so that the center of gravity moves to its proper position.
So the question is : how do I go from a directionless-spring model to a directed-spring model?
Thanks again.
[edit]
After spending a lot of time musing over this problem, I've come to the conclusion that I need to calculate the center of gravity and then for each weight in the model calculates its angular force on the model.
This is what I wanted to avoid though!
I wanted this behaviour to emerge from the 'low-level' processing of the spring forces, rather than calculating the forces from the higher-level perspective of the model (if you get what I mean ).
[edited by - carrot on December 16, 2002 12:30:50 PM]
The problem isn't keeping the anchor vertex steady (I just initialise the currently selected weight to zero gravitational pull).
The problem is when that vertex is selected (and so no gravity affecting it so it doesn't drop), I want the other vertices to swing so that the center of gravity moves to its proper position.
So the question is : how do I go from a directionless-spring model to a directed-spring model?
Thanks again.
[edit]
After spending a lot of time musing over this problem, I've come to the conclusion that I need to calculate the center of gravity and then for each weight in the model calculates its angular force on the model.
This is what I wanted to avoid though!
I wanted this behaviour to emerge from the 'low-level' processing of the spring forces, rather than calculating the forces from the higher-level perspective of the model (if you get what I mean ).
[edited by - carrot on December 16, 2002 12:30:50 PM]
<a href="http://www.purplenose.com>purplenose.com
This topic is closed to new replies.
Advertisement
Popular Topics
Advertisement
Recommended Tutorials
Advertisement