Shop OBEX P1 Docs P2 Docs Learn Events
Physics Engine Development — Parallax Forums

Physics Engine Development

The CaptainThe Captain Posts: 60
edited 2007-07-23 16:30 in Propeller 1
With the release of the Hydra last week, I thought it would be proper to share my idea with the community. I have always been fasicanted with games, exspecially those with realistic physics. I want to develop a physics engine for people to use.

I have read many a books on physics engine design and development but they only explain theory confused.gifconfused.gif , there's no actual code displayed. However I can understand the pretty pictures and am able to code what is displayed.

I will be receiving my Propeller Demo Board Kit along with the Hydra Book as my Christmas present to myself. After that, it's only a matter of time before I lay down the foundation for the engine.

Post Edited (The Captain) : 7/23/2007 4:32:28 PM GMT

Comments

  • BergamotBergamot Posts: 185
    edited 2006-11-21 20:00
    Rigid body?
  • AndreLAndreL Posts: 1,004
    edited 2006-11-22 00:47
    Mr. "The Captain", I think that at first I would attempt some "spring mass" simulations on the propeller using wire-frame graphics, those give the most bang for the buck and are "relatively" easy to do.


    Andre'
  • The CaptainThe Captain Posts: 60
    edited 2006-11-22 02:46
    I was think about projectile motion for first. But, knowing you exp. is far greater than mine, I shall take you advice.
  • AndreLAndreL Posts: 1,004
    edited 2006-11-22 08:05
    Projectile motion is pretty simple physics modeling, spring mass are 100x more complex and more like real physics, so you can simulate cloth, etc. If you want to do something in between then I would maybe try a simulation of a pool table where you take intertia into consideration, compute collision and response and compute the try trajectories of the balls after the collisions. This you can do in 2D and looks pretty cool.

    Andre'
  • The CaptainThe Captain Posts: 60
    edited 2006-11-22 16:27
    I've found some examples of spring-mass, and some code to example it. Not really that hard, I just have to understand Euler integration, which does look to bad, and remembering that i have to use small time steps or Euler takes a Smile on it's self.
  • PaulPaul Posts: 263
    edited 2006-11-22 19:10
    Spring-Mass & Projectile motion??? Are we talking Pin Ball??

    Paul
  • The CaptainThe Captain Posts: 60
    edited 2006-11-23 03:46
    How about instead working small and going big:

    Vector
    Newtonian Mechanics
    Angular Momentum
    Forward Euler
    Backward Euler
    Modified Euler
    RK2
    RK4
    Verlet
  • Dennis FerronDennis Ferron Posts: 480
    edited 2006-11-25 09:50
    There's an O'Reilly book on physics for game engines; it's pretty good and shows lots of code. I used to have it but I let someone borrow it and never got it back.
  • LewisLewis Posts: 23
    edited 2006-12-08 19:09
    Check out www.bit-101.com This guy seems to have a handle on it. Also, I read a book of his but it's for ActionScripters... You would apply the physics the same way though... minimal math and it looks great!

    If you know how to add acceleration to your motion graphics, then adding springs is easy. Setup tx and ty for your object and then calculate your acceleration based on how far you are from the target e.g. The farther away you are from your target, the faster you should accelerate.

    So if you have dx = (tx-this.x), scale it down by some spring value and add this to your acceleration and you should be good to go!

    ax += dx*spring // Spring is a value from 0-1
    vx += ax
    obj.x += vx

    Something like that... anyway, hope that helps.

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    - Lewis [noparse][[/noparse]m80] -
  • lnielsenlnielsen Posts: 72
    edited 2007-01-23 15:33
    I ran across this old thread during a search and I thought I would add another link.

    Check out Jed Margolin's web site http://www.jmargolin.com/. He was one of the key programmers for the Battlezone video game. I am always amazed by how much they did with so little hardware. His web site has several articles on the math he used.
  • The CaptainThe Captain Posts: 60
    edited 2007-07-23 16:30
    I know it's been a long time since I started this thread, but the development is not dead. Life seems get in the way at the worst time, and things have to be put on the back burner. With my birthday coming up shortly, I'll finally be getting a Prop and begin construction of the engine.
Sign In or Register to comment.