|
![](/i/fill.gif) |
> Can anyone give me a pointer on how to calculate/work out how a stick
> would fall then bounce when it hits a sloping floor?
> I could do a simple sphere but my brains are wracked with a cylinder
> :)
Three different methods I can think of (easiest and least realistic first):
1) Assume the stick is two point masses in 3D connected by a (stiff) spring.
Then, you can just deal with the two point masses by themselves, but add in
an extra force for the spring connecting them. If you make the spring stiff
enough it will look ok, you might need to use quite small time-steps though
to stop the spring exploding.
2) A kind of half-way stage would be to simulate the stick falling in 2D,
and assume it's just a line, that might make the maths a bit easier,
although you'll still need to mess about with moments of inertia and angular
velocities, just not in full 3D.
3) The more complex and correct way is as Aydan said, you need to also keep
track of the angular momentum and orientation of the stick (in addition to
the linear momentum and position) all in 3D. When either end comes into
contact with the ground you then need to apply a force and a torque to the
stick that will keep it above the ground. You'll need a good knowledge of
3D kinetics to make this one work - like how torques in 3D affect the
angular velocity, and how that affects the orientation etc, it's not as
simple as the linear cases, using quaternions makes things easier.
Post a reply to this message
|
![](/i/fill.gif) |