1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102
|
//global variables
Car objects(0.0, 0.0, 0.0, 100.0, 50.0, 0.0);
Car objects1(150.0, 0.0, 0.0, 100.0, 50.0, 0.0);
Car objects2(300.0, 0.0, 0.0, 100.0, 50.0, 0.0);
Car objects3(450.0, 0.0, 0.0, 100.0, 50.0, 0.0);
Car objects4(600.0, 0.0, 0.0, 100.0, 50.0, 0.0);
Car objects5(-150.0, 0.0, 0.0, 100.0, 50.0, 0.0);
Car objects6(-300.0, 0.0, 0.0, 100.0, 50.0, 0.0);
Car objects7(-450.0, 0.0, 0.0, 100.0, 50.0, 0.0);
Car objects8(-600.0, 0.0, 0.0, 100.0, 50.0, 0.0);
Car objects9(0.0, 0.0, -125.0, 100.0, 50.0, 0.0);
Car objects10(150.0, 0.0, -125.0, 100.0, 50.0, 0.0);
Car objects11(300.0, 0.0, -125.0, 100.0, 50.0, 0.0);
Car objects12(450.0, 0.0, -125.0, 100.0, 50.0, 0.0);
Car objects13(600.0, 0.0, -125.0, 100.0, 50.0, 0.0);
Car objects14(-150.0, 0.0, -125.0, 100.0, 50.0, 0.0);
Car objects15(-300.0, 0.0, -125.0, 100.0, 50.0, 0.0);
Car objects16(-450.0, 0.0, -125.0, 100.0, 50.0, 0.0);
Car objects17(-600.0, 0.0, -125.0, 100.0, 50.0, 0.0);
Terrain ground(0.0, 0.0, 0.0, 1500.0, 1500.0, 0.0);
Terrain road(0.0, 5.0, 0.0, 1500.0, 250.0, 1.0);
Terrain roadLine(0.0, 5.0, 0.0, 50.0, 10.0, 5.0);
Terrain building1(0.0, 40.0, -200.0, 50.0, (rand() % 75 + 100), 50.0);
Terrain building2(0.0, 40.0, -200.0, 50.0, (rand() % 75 + 100), 50.0);
Terrain building3(0.0, 40.0, -200.0, 50.0, (rand() % 75 + 100), 50.0);
Terrain building4(0.0, 40.0, -200.0, 50.0, (rand() % 75 + 100), 50.0);
Terrain building5(0.0, 40.0, -200.0, 50.0, (rand() % 75 + 100), 50.0);
Terrain building6(0.0, 40.0, -200.0, 50.0, (rand() % 75 + 100), 50.0);
Terrain building7(0.0, 40.0, -200.0, 50.0, (rand() % 75 + 100), 50.0);
Terrain building8(0.0, 40.0, -200.0, 50.0, (rand() % 75 + 100), 50.0);
Terrain building9(0.0, 40.0, -200.0, 50.0, (rand() % 75 + 100), 50.0);
Terrain building10(0.0, 40.0, -200.0, 50.0, (rand() % 75 + 100), 50.0);
Terrain building11(0.0, 40.0, -200.0, 50.0, (rand() % 75 + 100), 50.0);
Terrain building12(0.0, 40.0, -200.0, 50.0, (rand() % 75 + 100), 50.0);
Terrain building13(0.0, 40.0, -200.0, 50.0, (rand() % 75 + 100), 50.0);
Airplane plane(200.0, 0.0, 300.0, 25.0, 150.0, 5.0);
void renderFrame(float lastFrameDuration) {
setColor(1.0, 0.0, 0.0);
drawText(300.0, 750.0, "Welcome to Liberty City");
glClearColor(.52, .80, .97, 1.0);
enable3d();
setWireframeRendering(false);
glPushMatrix();
glRotatef(10.0, 1, 0, 0);
objects.drawCar();
objects1.drawCar();
objects2.drawCar();
objects3.drawCar();
objects4.drawCar();
objects5.drawCar();
objects6.drawCar();
objects7.drawCar();
objects8.drawCar();
objects9.drawCar1();
objects10.drawCar1();
objects11.drawCar1();
objects12.drawCar1();
objects13.drawCar1();
objects14.drawCar1();
objects15.drawCar1();
objects16.drawCar1();
objects17.drawCar1();
road.drawRoad();
ground.drawTerrain();
roadLine.drawRoadLine();
building1.drawBuilding1();
building2.drawBuilding2();
building3.drawBuilding3();
building4.drawBuilding4();
building5.drawBuilding5();
building6.drawBuilding6();
building7.drawBuilding7();
building8.drawBuilding8();
building9.drawBuilding9();
building10.drawBuilding10();
building11.drawBuilding11();
building12.drawBuilding12();
building13.drawBuilding13();
plane.drawAirplane();
glPopMatrix();
disable3d();
}
|