Car movement in Racing Games

Started by
2 comments, last by yanuart 22 years, 1 month ago
Hmm.. I was wondering.. how to implement the car movement so it will always attach to the road. this also goes for a game with a abritary terrain in which the game object walk around the terrain. If I want to implement a map data structure, I wish I can store only 2 dimensional data of the terrain and not the whole. Anybody got ideas ?
Ride the thrill of your life
Play Motorama
Advertisement
Hi,
the easiest way to do this is as within the donuts 3d demo, you must load your terrain from a .x file that represent a plane, it will be the floor. Then you have to modify its vertex coordinates by passing it by a mathematic function, then you have to modify de coordinates of the car passing it by the same mathematic function. Just check out the donuts 3d, it''s such a good example of the basics of loading a terrain and modifying its vertices.
For the first point I''m looking too.
For the second look for heightmap.

_______________

Jester, studient programmer
The Jester Home in French
_______________
Jester, studient programmerThe Jester Home in French
Hi again yanuar !

I have a 3d car demo -> the one in GDI site (it was a modified version of progressivemesh demo from DirectX 8.0), which does exactly what you asked.
It loads an arbitrary terrain from an .X file ( not just a heightmap ) then i detect the position of the four wheels of the car model on the terrain, and plays around with basic newtonian physics....
I dont fully recal the details, since it was just a quick try (made it in a week or so) but I can give you the full source code if you need them..Just mail me....

Regards,
Chris
email : chris_Senjaya@yahoo.com

This topic is closed to new replies.

Advertisement