# Game physics

**URL:** <https://discourse.libsdl.org/t/game-physics/6378>\
**Category:** SDL Development\
**Created:** [April 7, 2002, 10:51am UTC](https://discourse.libsdl.org/t/game-physics/6378 "2002-04-07T10:51:01Z")\
**Posts on this page:** 10\
**Page:** 1

<div class="post-metadata">

**Author:** ![James1](https://discourse.libsdl.org/user_avatar/discourse.libsdl.org/james1/32/134_2.png) [@James1](https://discourse.libsdl.org/u/James1)\
**Post date:** [April 7, 2002, 10:51am UTC](https://discourse.libsdl.org/t/game-physics/6378/1 "2002-04-07T10:51:01Z")

</div>

This might be off-topic…

Does anyone have any good URLs that explain how to apply physics to a  
sprite to make it act like a car does? Preferably one that either  
treats the reader like a moron, or one with example code.

So far I can simulate acceleration/deceleration, and make the car go in  
a particular direction (basically I’ve got an asteroids clone, but with  
car graphics).

I’m now having trouble working out how to make the car skid round  
corners. At the moment it just turns in a neat arc which isn’t too  
realistic\*.

- 
  - I don’t want 100% realism - I’m making a SuperSprint clone, not a  
completely accurate car simulator, but my current code feels "wrong"  
when you go round corners.–  
I will not prescribe medication

6AD6 865A BF6E 76BB 1FC2 | [www.piku.org.uk/public-key.asc](http://www.piku.org.uk/public-key.asc)  
E4C4 DEEA 7D08 D511 E149 | [www.piku.org.uk](http://www.piku.org.uk) wnzrf at cvxh.bet.hx (rot13’d)

---

<div class="post-metadata">

**Author:** ![Timo\_K\_Suoranta](https://discourse.libsdl.org/letter_avatar_proxy/v4/letter/t/5f9b8f/32.png) [@Timo\_K\_Suoranta](https://discourse.libsdl.org/u/Timo_K_Suoranta)\
**Post date:** [April 7, 2002, 1:01pm UTC](https://discourse.libsdl.org/t/game-physics/6378/2 "2002-04-07T13:01:01Z")

</div>

Google is your friend. Google with ‘car physics’.  
First hit is quite good article, maybe a bit too detail one for  
you, [http://home.planet.nl/~monstrous/tutcar.html](http://home.planet.nl/~monstrous/tutcar.html)

I found one source for car simulation from  
[http://www.cs.uni-magdeburg.de/~sodeike/](http://www.cs.uni-magdeburg.de/~sodeike/)

– Timo Suoranta – @Timo_K_Suoranta –

---

<div class="post-metadata">

**Author:** ![James1](https://discourse.libsdl.org/user_avatar/discourse.libsdl.org/james1/32/134_2.png) [@James1](https://discourse.libsdl.org/u/James1)\
**Post date:** [April 7, 2002, 1:44pm UTC](https://discourse.libsdl.org/t/game-physics/6378/3 "2002-04-07T13:44:00Z")

</div>

|  
| Google is your friend. Google with ‘car physics’.  
| First hit is quite good article, maybe a bit too detail one for  
| you, [http://home.planet.nl/~monstrous/tutcar.html](http://home.planet.nl/~monstrous/tutcar.html)

I’ve read that page. My brain seg-faulted when I tried reading the  
physics :-). I think I need a “physics for dummies” book…

| I found one source for car simulation from  
| [http://www.cs.uni-magdeburg.de/~sodeike/](http://www.cs.uni-magdeburg.de/~sodeike/)

Heh, if you’re American, you might not like the picture on their  
titlepage 🙂 Oh! it’s the little Java car simulation linked from the  
other page.

I did find one page that had some example C code too, but as with all  
things google, if you forget the search text, the page has gone  
forever.On Sun, Apr 07, 2002 at 11:00:39PM +0300, Timo K Suoranta wrote:

–  
Bart Bucks are not legal tender

6AD6 865A BF6E 76BB 1FC2 | [www.piku.org.uk/public-key.asc](http://www.piku.org.uk/public-key.asc)  
E4C4 DEEA 7D08 D511 E149 | [www.piku.org.uk](http://www.piku.org.uk) wnzrf at cvxh.bet.hx (rot13’d)

---

<div class="post-metadata">

**Author:** ![James1](https://discourse.libsdl.org/user_avatar/discourse.libsdl.org/james1/32/134_2.png) [@James1](https://discourse.libsdl.org/u/James1)\
**Post date:** [April 7, 2002, 2:48pm UTC](https://discourse.libsdl.org/t/game-physics/6378/4 "2002-04-07T14:48:00Z")

</div>

|  
| Google is your friend. Google with ‘car physics’.

Is that book “Physics for game developers” (ISBN 0596000065) worth  
buying?On Sun, Apr 07, 2002 at 11:00:39PM +0300, Timo K Suoranta wrote:

–  
I will not spin the turtle

6AD6 865A BF6E 76BB 1FC2 | [www.piku.org.uk/public-key.asc](http://www.piku.org.uk/public-key.asc)  
E4C4 DEEA 7D08 D511 E149 | [www.piku.org.uk](http://www.piku.org.uk) wnzrf at cvxh.bet.hx (rot13’d)

---

<div class="post-metadata">

**Author:** ![Blake\_Senftner](https://discourse.libsdl.org/user_avatar/discourse.libsdl.org/blake_senftner/32/170_2.png) [@Blake\_Senftner](https://discourse.libsdl.org/u/Blake_Senftner)\
**Post date:** [April 7, 2002, 4:28pm UTC](https://discourse.libsdl.org/t/game-physics/6378/5 "2002-04-07T16:28:00Z")

</div>

I have it, but only skimmed it so far. It looks like the real deal.  
There’s a whole chapter on car simulation, including a section on banking.\> ----- Original Message -----

> From: [james@piku.org.uk](mailto:james@piku.org.uk) (James)  
> To:   
> Sent: Sunday, April 07, 2002 2:47 PM  
> Subject: Re: [SDL] Re: Game physics
> 
> > On Sun, Apr 07, 2002 at 11:00:39PM +0300, Timo K Suoranta wrote:  
> > |  
> > | Google is your friend. Google with ‘car physics’.
> > 
> > Is that book “Physics for game developers” (ISBN 0596000065) worth  
> > buying?
> > 
> > –  
> > I will not spin the turtle
> > 
> > 6AD6 865A BF6E 76BB 1FC2 | [www.piku.org.uk/public-key.asc](http://www.piku.org.uk/public-key.asc)  
> > E4C4 DEEA 7D08 D511 E149 | [www.piku.org.uk](http://www.piku.org.uk) wnzrf at cvxh.bet.hx (rot13’d)
> > 
> > * * *
> > 
> > SDL mailing list  
> > SDL at [libsdl.org](http://libsdl.org)  
> > [http://www.libsdl.org/mailman/listinfo/sdl](http://www.libsdl.org/mailman/listinfo/sdl)

---

<div class="post-metadata">

**Author:** ![Sami\_Naatanen](https://discourse.libsdl.org/letter_avatar_proxy/v4/letter/s/ee7513/32.png) [@Sami\_Naatanen](https://discourse.libsdl.org/u/Sami_Naatanen)\
**Post date:** [April 7, 2002, 6:30pm UTC](https://discourse.libsdl.org/t/game-physics/6378/6 "2002-04-07T18:30:01Z")

</div>

Look at [gamedev.net](http://gamedev.net) there is a series of articles about racing physics.  
It’s quite good stuff and layered in such maner, that when the basics  
are in control, people can concentraint on the topics they want to  
improve in.On 2002.04.07 20:50 James wrote:

> This might be off-topic…
> 
> Does anyone have any good URLs that explain how to apply physics to a  
> sprite to make it act like a car does? Preferably one that either  
> treats the reader like a moron, or one with example code.
> 
> So far I can simulate acceleration/deceleration, and make the car go  
> in  
> a particular direction (basically I’ve got an asteroids clone, but  
> with  
> car graphics).
> 
> I’m now having trouble working out how to make the car skid round  
> corners. At the moment it just turns in a neat arc which isn’t too  
> realistic\*.
> 
> - 
> - I don’t want 100% realism - I’m making a SuperSprint clone, not a  
> completely accurate car simulator, but my current code feels “wrong”  
> when you go round corners.

---

<div class="post-metadata">

**Author:** ![HaB\_JacKaL](https://discourse.libsdl.org/letter_avatar_proxy/v4/letter/h/41988e/32.png) [@HaB\_JacKaL](https://discourse.libsdl.org/u/HaB_JacKaL)\
**Post date:** [April 7, 2002, 7:26pm UTC](https://discourse.libsdl.org/t/game-physics/6378/7 "2002-04-07T19:26:02Z")

</div>

> |  
> | Google is your friend. Google with ‘car physics’.
> 
> Is that book “Physics for game developers” (ISBN 0596000065) worth  
> buying?

PMFJI, but…

I looked at thayt book last night, and I too findmyself in the position of  
being several years out of math/geometry/physics schooling, and being quite  
bewildered as to how to do certain things. That book will make you cry.  
It is NOT geared towards a beginner in any way, shape or form. I saw it on  
the shelf and went “score!” until I actually picked it up. Pages and pages  
of cryptic formulas, with little to no explanation. Avoid it if you are  
looking for a ‘Physics for Dummies’ leve book. (As I am).

-HaB\>From: James

> Reply-To: sdl at [libsdl.org](http://libsdl.org)  
> To: sdl at [libsdl.org](http://libsdl.org)  
> Subject: Re: [SDL] Re: Game physics  
> Date: Sun, 7 Apr 2002 22:47:55 +0100  
> On Sun, Apr 07, 2002 at 11:00:39PM +0300, Timo K Suoranta wrote:

* * *

MSN Photos is the easiest way to share and print your photos:  
[http://photos.msn.com/support/worldwide.aspx](http://photos.msn.com/support/worldwide.aspx)

---

<div class="post-metadata">

**Author:** ![John\_R\_Hall](https://discourse.libsdl.org/letter_avatar_proxy/v4/letter/j/8797f3/32.png) [@John\_R\_Hall](https://discourse.libsdl.org/u/John_R_Hall)\
**Post date:** [April 7, 2002, 9:15pm UTC](https://discourse.libsdl.org/t/game-physics/6378/8 "2002-04-07T21:15:01Z")

</div>

Invest in the book _Physics for Game Developers_, from O’Reilly.  
It seems to be exactly what you are looking for.

-JohnOn Sun, Apr 07, 2002 at 06:50:28PM +0100, James wrote:

> This might be off-topic…
> 
> Does anyone have any good URLs that explain how to apply physics to a  
> sprite to make it act like a car does? Preferably one that either  
> treats the reader like a moron, or one with example code.
> 
> So far I can simulate acceleration/deceleration, and make the car go in  
> a particular direction (basically I’ve got an asteroids clone, but with  
> car graphics).
> 
> I’m now having trouble working out how to make the car skid round  
> corners. At the moment it just turns in a neat arc which isn’t too  
> realistic\*.
> 
> - 
> - I don’t want 100% realism - I’m making a SuperSprint clone, not a  
> completely accurate car simulator, but my current code feels “wrong”  
> when you go round corners.

–  
John R. Hall - KG4RUO - Stranded in the Sol System  
Student, Georgia Tech; Author, Programming Linux Games

---

<div class="post-metadata">

**Author:** ![Jason\_Farmer](https://discourse.libsdl.org/letter_avatar_proxy/v4/letter/j/a88e57/32.png) [@Jason\_Farmer](https://discourse.libsdl.org/u/Jason_Farmer)\
**Post date:** [April 8, 2002, 6:34am UTC](https://discourse.libsdl.org/t/game-physics/6378/9 "2002-04-08T06:34:01Z")

</div>

I purchased the “physics for game developers” book a little while ago (as  
soon as it was published, I saw it on Amazon and also went “Score!”) and when  
I first started reading it, I started to get my “Hard Math” headache… But  
as you read on you find that the maths is explained quite well and there are  
lots of diagrams to help you to get a feel for what’s going on. Also, the  
source code examples seem quite thorough (Although I’ve not tested them,  
They’re in C and I’m a pascal man)

I’d recommend that you get the book, read it and see what you think. if the  
math troubles you, get a book on maths to help you out. Because, to be  
honest, you’ll need the maths eventually anyway. Physics and maths are very  
closely tied.

Also… I’d recommend that you take a look at “Mathematics for 3D Game  
programming & Computer Graphics” by Eric Lengyel ISBN: 1-58450-037-9  
There is an excellent trig reference section at the back which may be  
helpful. That book may be a bit much for the beginner though.

Just my 2 pence

Jason\> \>On Sun, Apr 07, 2002 at 11:00:39PM +0300, Timo K Suoranta wrote:

> > | Google is your friend. Google with ‘car physics’.
> > 
> > Is that book “Physics for game developers” (ISBN 0596000065) worth  
> > buying?
> 
> PMFJI, but…
> 
> I looked at thayt book last night, and I too findmyself in the position of  
> being several years out of math/geometry/physics schooling, and being quite  
> bewildered as to how to do certain things. That book will make you cry.  
> It is NOT geared towards a beginner in any way, shape or form. I saw it on  
> the shelf and went “score!” until I actually picked it up. Pages and pages  
> of cryptic formulas, with little to no explanation. Avoid it if you are  
> looking for a ‘Physics for Dummies’ leve book. (As I am).
> 
> -HaB
> 
> * * *
> 
> MSN Photos is the easiest way to share and print your photos:  
> [http://photos.msn.com/support/worldwide.aspx](http://photos.msn.com/support/worldwide.aspx)
> 
> * * *
> 
> SDL mailing list  
> SDL at [libsdl.org](http://libsdl.org)  
> [http://www.libsdl.org/mailman/listinfo/sdl](http://www.libsdl.org/mailman/listinfo/sdl)

---

<div class="post-metadata">

**Author:** ![Dan\_G\_Lunde](https://discourse.libsdl.org/letter_avatar_proxy/v4/letter/d/c67d28/32.png) [@Dan\_G\_Lunde](https://discourse.libsdl.org/u/Dan_G_Lunde)\
**Post date:** [April 9, 2002, 12:22pm UTC](https://discourse.libsdl.org/t/game-physics/6378/10 "2002-04-09T12:22:01Z")

</div>

> | I found one source for car simulation from  
> | [http://www.cs.uni-magdeburg.de/~sodeike/](http://www.cs.uni-magdeburg.de/~sodeike/)

> I did find one page that had some example C code too, but as with all  
> things google, if you forget the search text, the page has gone  
> forever.

Here is antoher one:  
[http://www.neutralzone.org/home/faqsys/cates/papers.html](http://www.neutralzone.org/home/faqsys/cates/papers.html)

## Dan\> On Sun, Apr 07, 2002 at 11:00:39PM +0300, Timo K Suoranta wrote:
