public void render() {

		// Get the loaded materials and initialise necessary variables
		Material[] materials = trackMesh.materials;
		Material material;
		Triangle drawTriangle;
		int currentMaterial = -1;
		int triangle = 0;

		// For each triangle in the object
		for (triangle = 0; triangle < trackMesh.triangles.length;) {

			// Get the triangle that needs to be drawn
			drawTriangle = trackMesh.triangles[triangle];

			// Activate a new material and texture
			currentMaterial = drawTriangle.materialID;
			material = (materials != null && materials.length > 0 && currentMaterial >= 0) ? materials[currentMaterial]
					: defaultMtl;
			material.apply();
			GL11.glBindTexture(GL11.GL_TEXTURE_2D, material.getTextureHandle());

			// Draw triangles until material changes
			GL11.glBegin(GL11.GL_TRIANGLES);
			while (triangle < trackMesh.triangles.length
					&& drawTriangle != null
					&& currentMaterial == drawTriangle.materialID) {

				GL11.glTexCoord2f(drawTriangle.texture1.x,
						drawTriangle.texture1.y);
				GL11.glNormal3f(drawTriangle.normal1.x, drawTriangle.normal1.y,
						drawTriangle.normal1.z);
				GL11.glVertex3f((float) drawTriangle.point1.pos.x,
						(float) drawTriangle.point1.pos.y,
						(float) drawTriangle.point1.pos.z);

				GL11.glTexCoord2f(drawTriangle.texture2.x,
						drawTriangle.texture2.y);
				GL11.glNormal3f(drawTriangle.normal2.x, drawTriangle.normal2.y,
						drawTriangle.normal2.z);
				GL11.glVertex3f((float) drawTriangle.point2.pos.x,
						(float) drawTriangle.point2.pos.y,
						(float) drawTriangle.point2.pos.z);

				GL11.glTexCoord2f(drawTriangle.texture3.x,
						drawTriangle.texture3.y);
				GL11.glNormal3f(drawTriangle.normal3.x, drawTriangle.normal3.y,
						drawTriangle.normal3.z);
				GL11.glVertex3f((float) drawTriangle.point3.pos.x,
						(float) drawTriangle.point3.pos.y,
						(float) drawTriangle.point3.pos.z);

				triangle++;
				if (triangle < trackMesh.triangles.length)
					drawTriangle = trackMesh.triangles[triangle];
			}
			GL11.glEnd();
		}
	}