Pogo stick physics

Started by
30 comments, last by DuncanBojangles 19 years, 10 months ago
Hey guys. Still at work on my pogo stick game, now that it''s actually fun for me to play, *cough*, test it. I''m a little mystified about the physics. You see, I set it up so that when the pogo stick hits the ground, a vector is produced by doing some [insert funny vector math stuff] with the normal of the ground (which is uneven). Well, it works like it is supposed to. I watch my little guy, and whenver he bounces on something, he''ll move a little in the direction the ground is facing, just like I do in real life, bouncing on an incline. I''ve noticed, though, that he can''t get over very steep stuff. Should I be considering adding momentum to the equation? Because he''s leaning pretty far forward and he should be going farther each jump. Currently, each time the pogo stick comes in contact with the ground, the resulting direction vector is a combination of his angles to the ground and the normal of the ground. I just realized that I don''t know if normal is even the right word. It''s the same thing used in lighting calculations, if that helps. It''s 3:30 in the morning. I need sleep. "Donkey, if it were me, you''d be dead." I cna ytpe 300 wrods pre mniute.
"Donkey, if it were me, you'd be dead."I cna ytpe 300 wrods pre mniute.
Advertisement
ya, you need to factor in the guy''s weight... & based on his/her height, you can just place the weight at the character''s center of gravity. So the resulting motion of the character is effacted by its existing momentum plus the force on the character from the stick. you''ll need to develop a tricky system that gives you frame-rate independent motion. so a little integration will be necessary.
I''ve already got the time-independent motion part done, that was last post I looked in everything I could find related to physics, and it seems there''s no *good* way to cut corners for *real enough* and speedy. I''ll have to use the formulae, but I won''t include rotational accelerations as the guy kinda rotates, then holds that position, so acceleration is instaneously 0 (unless that''s the exact moment he hits the ground, in which case I''ll make him fall ... Muahahahah!) Thanks for the help, lonely poster.

"Donkey, if it were me, you''d be dead."
I cna ytpe 300 wrods pre mniute.
"Donkey, if it were me, you'd be dead."I cna ytpe 300 wrods pre mniute.
I''ve done a simulation of a spinning top which is kinda similar since you have translation and rotation at the same time.

If you want to do it physically correct, you need the equations of motion of a rotating system. It tells you how to change the current axis of rotation (direction and rotational speed). You end up with an ordinary differential equation (just like Newton''s motion, though a bit more complicated and non-linear) and you can use the same method of integration (i.e. time-stepping). Grab a good physics book and read the chapter about rigid body motion (I only know the German word, I tried to translate it).

Is it 2D or 3D motion?
good question about the 2d / 3d motion... are there slants so that if the guy who is jumping forward on the stick... could be bounced to the left or right or is it like a side scrolling game? in either case... the same rules apply...

I don''t think its as hard to calculate these things as you make it sound... as soon as the pogo stick touches the ground... lets assume no slippage... you can take the point & over the time period that the stick is touching the ground... you just calculate the force (along the length of the stick) & apply it to the guy''s momentum. your framerate independent movement will have to do many calculations over a frame or just a couple... because of the small piecewise integration of the force & momentum. The force of the stick has to do with spring physics of course... & one of the nice features you might include... is bigger & better sticks... & maybe even fatter/skinnier characters... that will bounce differently.
That's an interesting question you have there. What you *may* be forgetting is that to equate force with momentum you need to multiply the force by a minute frame of time, namely the time of impact (also called impulse). Just add the impulse vector to the momentum vector to get a reasonable result (just to be clear, the force here is the Force the ground exerts in the direction of its Normal). Physics is a pain isn't it? The only problem now is picking suitable collision timeframes and/or momenta. When lutz says ordinary differential equations he means the general solution for the differential equation F = -kx", which is well-known as something along the lines of x(t) = sin(wt)*e^(-bt) + cos(wt)*e^(bt). You can probably find it online somewhere. I'm pretty sure just conserving energy will work fine, because non-linear differential equations are probably a little more complicated than you really want here.

[edited by - uber_n00b on May 27, 2004 12:33:16 AM]
My fellow Americans I have just signed legislation that outlaws Russia forever. Bombing will commence in five minutes.
Thanks for all the tips guys! The "simulation" is in 3d so he can bounce in all directions, though I limit his ability to rotate himself on the y (turning around) axis and the x (forward or backward) axis. I left out z axis rotation ''cause I couldn''t find an equation I liked that didn''t require too much change on my whole game physics. He has full range of "bounce off of ground" motion. I cheated on the spring physics by just giving him an arbitrary force along the vector of his direction. I wanted to know what the bare minimum was to get "realistic enough" bounce and movement without bogging my game (and my time) down in physics. I''ll try out all of your tips and see what works best.

"Donkey, if it were me, you''d be dead."
I cna ytpe 300 wrods pre mniute.
"Donkey, if it were me, you'd be dead."I cna ytpe 300 wrods pre mniute.
Sorry to resurrect a dead (or near dead) post, but I''m having a bit of trouble understanding pretty much any physics at the moment. From what I remember from high school, the three things affecting this guy''s movement are gravity, momentum, and the force created when he bounces off of the ground. I can find (sorta) the force that is created when the guy bounces off of the ground using an arbitrary value as "amount of bounce" and the normal of the surface he is bouncing off of. The force that is calculated, is that the momentum? The only other thing affecting his movement is gravity. The force is constant, and gravity is added to it to make the guy move. So is this momentum?

"Donkey, if it were me, you''d be dead."
I cna ytpe 300 wrods pre mniute.
"Donkey, if it were me, you'd be dead."I cna ytpe 300 wrods pre mniute.
Don''t be sorry ^^, we all have that understanding physics issue. Heck I''m fresh out of AP Physics C (M) and all that basic BS catches me. Momentum has this relationship with Force:

F = dp/dt , therefore, by multiplying by a small fraction of time (dt) you can figure out what P is by multiplying the force by that small fraction (which is the appropriate value to add to the momentum of the pogo stick to push it out and away via the normal.
My fellow Americans I have just signed legislation that outlaws Russia forever. Bombing will commence in five minutes.
Sorry to ask, but what is ''p'' in your formula? I know that force is change in velocity divided by change in time, so I''m not sure what you mean by ''p''.

"Donkey, if it were me, you''d be dead."
I cna ytpe 300 wrods pre mniute.
"Donkey, if it were me, you'd be dead."I cna ytpe 300 wrods pre mniute.

This topic is closed to new replies.

Advertisement