Jump to content
  • Advertisement

Archived

This topic is now archived and is closed to further replies.

yanuart

Car movement in Racing Games

This topic is 6012 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

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 ?

Share this post


Link to post
Share on other sites
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.

Share this post


Link to post
Share on other sites
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

Share this post


Link to post
Share on other sites

  • Advertisement
×

Important Information

By using GameDev.net, you agree to our community Guidelines, Terms of Use, and Privacy Policy.

We are the game development community.

Whether you are an indie, hobbyist, AAA developer, or just trying to learn, GameDev.net is the place for you to learn, share, and connect with the games industry. Learn more About Us or sign up!

Sign me up!