Having problems with springs and gravity

laserpilot's picture

I've been working on a kinect based kickball simulator but I'm having a rough time with working with the QC physics.

I have most of the forces worked out with the inertia dev demos, but I'm not quite getting the look I want.

I'm primarily trying to get gravity (force) to act on the ball, but have it bounce when it hits the boundaries of the frame. If I use limit to destination it sort of works, but it does this awkward bounce where it hardlines and looks like it sticks/slides, but then bounces. Tried the inertia with bouncy limits patch, but combining that with a gravity force just makes things go out of bounds or not function correctly.

Attached is a demo of one way I've been trying it, but it's a hack up of the great spring chain demo dust just posted...I wanted to see if his would give me more insight, but I'm still not sure.

Anyone got an idea of the trick? Maybe it's just a matter of tuning the values correctly.

PreviewAttachmentSize
Spring and gravity.qtz58.2 KB

Comment viewing options

Select your preferred way to display the comments and click "Save settings" to activate your changes.

dust's picture
Re: Having problems with springs and gravity

you can feed your without gravity macro into your with gravity macro and and turn it on to sample all the time and set your spring stiffness to -9 and it will sort of act like gravity. you can look at some of my particle physics examples if you want to see how to do a free fall with terminal velocity and gravity via euler linear simple and euler richardson taylor expansions.

http://kineme.net/composition/dust/ParticlePhysics

i have a more in-depth explanation on physics and springs on website with some example and source codes.

http://www.dustino.co/nnor/code/source/momentum-spring-chains/

PreviewAttachmentSize
Spring and gravity copy.qtz123.12 KB