What would be a good approach to develop the render system for an oldschool type racing game that uses a pseudo 3D scenery, like for example Outrun or Lotus Esprit Turbo Challenge? There's an endless scrolling road and scenery graphics are placed like billboard items, etc. I think you get the idea.
Are these developed in a similar way like Mode7 or is there a different technique behind it? Does the technique has a specific name I could search for on the web? I need to develop something like that in Flash.
Answer
There's an excellent article out there that explains the 3D rendering of these games in detail. And you'll also find a complete implementation in JavaScript here.
The basic idea is as follows: You divide your screen into a number of strips and use perspective-projection to calculate the texture-coordinates (scaling and y position inside the road-texture) for each strip. Then you draw the portion of the texture into the strip, resulting in a road that vanishes in the distance.
No comments:
Post a Comment