Pendulum physics
Moderator: InsideQC Admins
16 posts
• Page 2 of 2 • 1, 2
you might want to try something simpler than a rope for just a swinging lamp.
instead of treating like a rope, treat it like a ball and socket joint, which is a much simpler problem.
because the lamp is hanging, we know it must always accelerate in such a way as to end up perpendicular with the ground (or parallel with gravity).
you can simple take the dot product of the current direction * '0 0 -1' and use that to determine how much angular velocity you will dump into it each frame.
then just put some simple velocity reduction to simulate friction, and tune the numbers till the movement looks real and you're done.
instead of treating like a rope, treat it like a ball and socket joint, which is a much simpler problem.
because the lamp is hanging, we know it must always accelerate in such a way as to end up perpendicular with the ground (or parallel with gravity).
you can simple take the dot product of the current direction * '0 0 -1' and use that to determine how much angular velocity you will dump into it each frame.
then just put some simple velocity reduction to simulate friction, and tune the numbers till the movement looks real and you're done.
- necros
- Posts: 77
- Joined: Thu Dec 16, 2004 10:32 pm
16 posts
• Page 2 of 2 • 1, 2
Who is online
Users browsing this forum: No registered users and 1 guest