[Author Prev][Author Next][Thread Prev][Thread Next][Author Index][Thread Index]
[pygame] Orbiting bodies in pymunk
- To: pygame-users@xxxxxxxx
- Subject: [pygame] Orbiting bodies in pymunk
- From: B W <stabbingfinger@xxxxxxxxx>
- Date: Fri, 1 Oct 2010 22:30:21 -0700
- Delivered-to: archiver@xxxxxxxx
- Delivered-to: pygame-users-outgoing@xxxxxxxx
- Delivered-to: pygame-users@xxxxxxxx
- Delivery-date: Sat, 02 Oct 2010 01:30:28 -0400
- Dkim-signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:mime-version:received:received:date:message-id :subject:from:to:content-type; bh=UDLWnAeXazznvUqi7I7HH3wLV6wtzeCz1pq5MHjcybo=; b=KmKwM0OIp/Oqvp9BmNE4QS2nfeVt46eOjeATRMor9COkhTw7XIHq/Cx+7eZUJKwtte YlTyK0IjdLi80H8lde+F6fzbJWS2GAZu/K8hIgPlSNOv55RE/CT3j+thXFFxHrPSDxER gqeb+zmOzL0w8Df/sjuV9oyY3ya0Fub8RGGx4=
- Domainkey-signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=mime-version:date:message-id:subject:from:to:content-type; b=rF2SDmxwyRHtO8xrqEae8Sj4IhakS+Vyimq3hkx+A7w9sBgnEgoflFhkg1UxvselB9 frHwrfJ5+oss7qDdsngu6CBh4gUgS8KR0U82TmDAVb1Z6cGnat7eekpUFT53obiCtLm8 EJwKzjeT9Pe9yXOXoOiaXLJhnKByaP4f1dNoY=
- Reply-to: pygame-users@xxxxxxxx
- Sender: owner-pygame-users@xxxxxxxx
Howdy, folks.
I made a small pymunk demo in which a Pygame sprite orbits the mouse pointer. I'm trying to figure out a way to get an elliptical orbiting body. Body.impulse is the only thing that appears to behave how I want, but after many hours of experimentation there remain gross eccentricities in the orbit that I can't resolve. The ball circles around the mouse a few times, its orbit decaying, then flips around the other way; and cycles back and forth between the two orbit-like patterns. It seems there are other influences at work: pymunk physics I don't know about yet, or maybe precision errors, or perhaps I'm just doing it all wrong.
I did the poring over docs thing, digging in modules, searching for demos and articles, and came up rather empty. Certainly nothing on topic. I did find a lot of complaints, though, about the dearth of pymunk demos. :)
If you are inclined to take a look, you'll need:
05_impulse.py
game_clock.py
pymunk
Use the down arrow to slow the ball if it gets going too fast, and move the mouse a little to guide the ball into an elliptical path.
I sure would appreciate some new insight. Thanks in advance for any assistance.
Gumm