-1

I was following this tutorial: https://www.codeproject.com/tips/357063/a-very-simple-car-race-game-in-csharp-and-opengl

Determining place in this game is trivial, as the cars only move in one dimension on a straight line. How would it be done in more generic maps with the cars moving in more than one dimension?

EDIT: By place, I mean 1st, 2nd, 3rd place, ad nauseum.

How do you determine which car is closer to finishing than the others?

1 Answers1

1

In 3D Racing Games, how is place determined?

By that I assume you mean position.

If so by a simple scalar quanity.

Cars on a 3D race track in a computer or reality, are still constrained to being on a "road". Assuming no intersections, you can ignore the third dimension. Because a track is a loop, you can also unwind it and any point on the path can be a scalar value between 0 and 1 with:

  • 0 being the start of the track
  • 0.5 half-way along; and
  • 1 reaching the start again