Okay, I've been racking my brain for a while how to do this.
It might be simple. Imagine a square rotating, no problems there, easy peasy.
Now imagine it toppling over from corner to edge over and over, how the heck would I do that in Processing?
If you're at a loss what I'm trying to explain watch the youtube video here:
http://www.youtube.com/watch?v=6QoxbEANfsY , now just transfer that into 2D. The ground is an imaginary line going from left to right, but I never want it to dip lower than that, but still always be in contact.