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

Re: [pygame] physics basics?



On Wed, 16 Oct 2002, Magnus Lie Hetland wrote:

> The problem with this is that it is simply a (rather poor)
> approximate numerical solution to the equations to which
> you just referred (Euler's method of numerical integration
> or somesuch).

I hadn't thought of that. My calculus is a little rusty, but
I do remember that it dealt with ALL the possible values of
x, where the distance between ticks shrinks to zero. Is that
what you're saying?


> > Elsewhere, Grand points out that the reason Newton had to
> > invent calculus was that he didn't have a computer to do
> > simple addition! :)
> 
> That's one way of putting it, of course. Another is that given
> Newton's assumptions (his three laws), his calculus gives exact
> results, while the "simple addition" method does not.

Good point.


> But, of course, in games you may well not be interested in
> that level of accuracy -- or in the end result. And the
> more complex the physical system you want to simulate, the
> less likely it is that you'll want to actually solve the
> differential equations describing it... :]


One of Grand's examples is a racecar game. Apparently he
worked on one a long time ago. The developers wanted to hard
code the equations for swerving, breaking, etc. He argued
for modelling the rules of physics and letting these
behaviors emerge on their own.

When you run the bouncing ball code, it actually does look
like the path of a bouncing ball.  Can we look at a more
complex example though?

There's a nice physics demo that uses macromedia flash:

    http://www.illogicz.com/flash5/physicsengine/

I don't see the actionscript code anywhere, but it seems
like a nice system. It brings up two big questions for me:

   1. how is he dealing with all those curved surfaces?
   2. which model (equations or rules) works best for this
      kind of thing?

> P.S: After some more thumbing I see that chapter 11,
> "Real-Time Simulations" *does* include material on Euler's
> method, improved Euler, and Runge-Kutta. So, basically,
> Grand's way of doing things is described here as well. If
> you don't get queasy by a few equations, it's well worth
> the look.

Thanks. I admit I never got that far! :) I'll take a look.
 

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