[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [pygame] physics basics?



On 17 Oct 2002, Michael Hudson wrote:

> Michal Wallace <sabren@manifestation.com> writes:
> 
> > Grand creates a world where at each tick of the clock,
> > simulated forces are applied to simulated objects. In other
> > words, rather than hard coding the bouncing equation, he
> > gives code for gravity and inertia and the correct path of
> > the ball emerges naturally.
> 
> But you run the risk of getting screwed by roundoff with this
> approach, e.g. suddenly your ball ends up on the other side of the
> barrier or something.

Well, in this case the code explicitly says that if you're
past the wall or past the floor, set it back, so it wouldn't
happen... I'm sure things get more complicated as you add
more shapes, but I don't really understand why the problem
is inherent in the approach. Wouldn't you deal with the same
issues even if you used an equation to model the path?  Can
you give me another example of this kind of problem?

Cheers,

- Michal   http://www.sabren.net/   sabren@manifestation.com 
------------------------------------------------------------
Switch to Cornerhost!             http://www.cornerhost.com/
 Low Priced, Reliable Blog Hosting, With a Human Touch. :)
------------------------------------------------------------

____________________________________
pygame mailing list
pygame-users@seul.org
http://pygame.seul.org