Rendering a Track and Multiple Go-Karts

Before you can do any of those things, first you need something interesting to be rendered. You currently have a single go-kart being rendered, which is all well and good, but it doesn't give you much opportunity to see anything if you render a scene into your texture. To change this situation, first you should set up your code to create and render multiple go-karts.

Find the declaration to your go-kart variables for the mesh and textures and replace them with these:

// Kart mesh
private const int NumberKarts = 5;
private Mesh[] kartMeshes = null;
private Texture[][] kartTextures = null;

// Track mesh
private Mesh trackMesh = null;
private Texture[] trackTextures = null;

Along with creating an array of ...

Get Beginning 3D Game Programming now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.