Jump to content
  • Advertisement
Sign in to follow this  

simple constraint equation, feedback wanted

This topic is 3663 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

Hello all, Trying to wrap my mind around the concept of rigid body constraints I've started out with finding a straight-forward solution to the simple "bead-on-a-circular-wire" problem: For each program loop I simply find the point on the circle closest to the bead's actual position, and then I calculate backwards and find the exact force needed to make the bead move to that spot within one timestep, its current position and velocity taken into consideration. since both current bead position and the desired "rest-position" vectors are known, I can find the neccesary force: dv = dx / dt a = (dv - db) / dt f = m * a or simply f = m * ( (dx / dt) - vb)/dt where f = force, m = mass, a = acceleration, dv = the required velocity, dx = distance vector the bead needs to travel, db = bead velocity vector projected onto normalised distance vector. The method seems incredibly stable, and the energy of the system doesn't change over time, so I assume no work is done by the constraint. I'd really appreciate some feedback on wether this method is any good in the bigger perspective or wether it's a dead-end. Can this method be generalized to constrain for instance a row of particles forming a rigid chain or similar bigger bodies of interconnected particles? Please help a novice along! (small example program + commented source: http://www.jernmager.dk/stuff/rigid_constraint.zip) Cheers, Michael

Share this post

Link to post
Share on other sites
Sign in to follow this  

  • Advertisement

Important Information

By using GameDev.net, you agree to our community Guidelines, Terms of Use, and Privacy Policy.

GameDev.net is your game development community. Create an account for your GameDev Portfolio and participate in the largest developer community in the games industry.

Sign me up!