Advertisement
RoshHoul

I SAID BAAAALLS MATE

Apr 4th, 2017
73
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C++ 4.04 KB | None | 0 0
  1. void generateMap() {
  2.  
  3.     Ball ball1(glm::vec3(0.0, 0.0, 0.0), textures[0]);
  4.     Ball ball2(glm::vec3(0.0, 0.0, 0.0), textures[1]);
  5.     Ball ball3(glm::vec3(0.0, 0.0, 0.0), textures[2]);
  6.     Ball ball4(glm::vec3(0.0, 0.0, 0.0), textures[3]);
  7.     Ball ball5(glm::vec3(0.0, 0.0, 0.0), textures[4]);
  8.     Ball ball6(glm::vec3(0.0, 0.0, 0.0), textures[5]);
  9.     Ball ball7(glm::vec3(0.0, 0.0, 0.0), textures[6]);
  10.     Ball ball8(glm::vec3(0.0, 0.0, 0.0), textures[7]);
  11.     Ball ball9(glm::vec3(0.0, 0.0, 0.0), textures[8]);
  12.     Ball ball10(glm::vec3(0.0, 0.0, 0.0), textures[9]);
  13.     Ball ball11(glm::vec3(0.0, 0.0, 0.0), textures[10]);
  14.     Ball ball12(glm::vec3(0.0, 0.0, 0.0), textures[11]);
  15.     Ball ball13(glm::vec3(0.0, 0.0, 0.0), textures[12]);
  16.     Ball ball14(glm::vec3(0.0, 0.0, 0.0), textures[13]);
  17.     Ball ball15(glm::vec3(0.0, 0.0, 0.0), textures[14]);
  18.     Ball ball16(glm::vec3(0.0, 0.0, 0.0), textures[15]);
  19.    
  20.     int elemNum = 0;
  21.  
  22.     for (int i = 0; i < 16; i++) {
  23.         if (i == 0) {
  24.             modelPos[i] = modelPos[i] + glm::vec3(0.0f, 0.0f, 0.0f);
  25.             cout << "First" << endl;
  26.         }
  27.  
  28.         if (i > 0 && i < 5) {
  29.             modelPos[i] = modelPos[i - 1] + glm::vec3(2.1f, 0.0f, 0.0f);
  30.             cout << "Second loop" << endl;
  31.             cout << "Ball number" << i << " is on coordinates " << modelPos[i].x << ", " << modelPos[i].z << endl;
  32.  
  33.         }
  34.  
  35.         if (i > 4 && i < 9) {
  36.             modelPos[i] = modelPos[i - 5] + glm::vec3(1.1f, 0.0f, -2.1f);
  37.             cout << "Third loop" << endl;
  38.             cout << "Ball number" << i << " is on coordinates " << modelPos[i].x << ", " << modelPos[i].z << endl;
  39.         }
  40.  
  41.         if (i > 8 && i < 12) {
  42.             modelPos[i] = modelPos[i - 4] + glm::vec3(1.1f, 0.0f, -2.1f);
  43.             cout << "Fourth loop" << endl;
  44.             cout << "Ball number" << i << " is on coordinates " << modelPos[i].x << ", " << modelPos[i].z << endl;
  45.         }
  46.  
  47.         if (i == 12 || i == 13) {
  48.             modelPos[i] = modelPos[i - 3] + glm::vec3(1.1f, 0.0f, -2.1f);
  49.             cout << "Fifth loop" << endl;
  50.             cout << "Ball number" << i << " is on coordinates " << modelPos[i].x << ", " << modelPos[i].z << endl;
  51.         }
  52.  
  53.         if (i == 14) {
  54.             modelPos[i] = modelPos[i - 2] + glm::vec3(1.1f, 0.0f, -2.1f);
  55.             cout << "Ball number" << i << " is on coordinates " << modelPos[i].x << ", " << modelPos[i].z << endl;
  56.         }
  57.     }
  58.  
  59.  
  60.     ball1.ballPos = modelPos[0];
  61.     ball1.makeSphere();
  62.     ball1.loadTexture();
  63.     ballCollection.push_back(ball1);
  64.  
  65.     ball2.ballPos = modelPos[1];
  66.     ball2.makeSphere();
  67.     ball2.loadTexture();
  68.     ballCollection.push_back(ball2);
  69.  
  70.     ball3.ballPos = modelPos[2];
  71.     ball3.makeSphere();
  72.     ball3.loadTexture();
  73.     ballCollection.push_back(ball3);
  74.  
  75.     ball4.ballPos = modelPos[3];
  76.     ball4.makeSphere();
  77.     ball4.loadTexture();
  78.     ballCollection.push_back(ball4);
  79.  
  80.  
  81.     ball5.ballPos = modelPos[4];
  82.     ball5.makeSphere();
  83.     ball5.loadTexture();
  84.     ballCollection.push_back(ball5);
  85.  
  86.  
  87.     ball6.ballPos = modelPos[5];
  88.     ball6.makeSphere();
  89.     ball6.loadTexture();
  90.     ballCollection.push_back(ball6);
  91.  
  92.  
  93.     ball7.ballPos = modelPos[6];
  94.     ball7.makeSphere();
  95.     ball7.loadTexture();
  96.     ballCollection.push_back(ball7);
  97.  
  98.  
  99.     ball8.ballPos = modelPos[7];
  100.     ball8.makeSphere();
  101.     ball8.loadTexture();
  102.     ballCollection.push_back(ball8);
  103.  
  104.  
  105.     ball9.ballPos = modelPos[8];
  106.     ball9.makeSphere();
  107.     ball9.loadTexture();
  108.     ballCollection.push_back(ball9);
  109.  
  110.  
  111.     ball10.makeSphere();
  112.     ball10.loadTexture();
  113.     ball10.ballPos = modelPos[9];
  114.     ballCollection.push_back(ball10);
  115.  
  116.     ball11.makeSphere();
  117.     ball11.loadTexture();
  118.     ball11.ballPos = modelPos[10];
  119.     ballCollection.push_back(ball11);
  120.  
  121.     ball12.ballPos = modelPos[11];
  122.     ball12.makeSphere();
  123.     ball12.loadTexture();
  124.     ballCollection.push_back(ball12);
  125.  
  126.     ball13.makeSphere();
  127.     ball13.loadTexture();
  128.     ball13.ballPos = modelPos[12];
  129.     ballCollection.push_back(ball13);
  130.  
  131.     ball14.makeSphere();
  132.     ball14.loadTexture();
  133.     ball14.ballPos = modelPos[13];
  134.     ballCollection.push_back(ball14);
  135.  
  136.     ball15.makeSphere();
  137.     ball15.loadTexture();
  138.     ball15.ballPos = modelPos[14];
  139.     ballCollection.push_back(ball15);
  140.  
  141.  
  142.     modelPos[15] = glm::vec3{ 0.0f, 0.0f, 20.0f };
  143.     Ball white(modelPos[15], textures[15]);
  144.     white.makeSphere();
  145.     white.loadTexture();
  146.     ballCollection.push_back(white);
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement