Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- void generateMap() {
- Ball ball1(glm::vec3(0.0, 0.0, 0.0), textures[0]);
- Ball ball2(glm::vec3(0.0, 0.0, 0.0), textures[1]);
- Ball ball3(glm::vec3(0.0, 0.0, 0.0), textures[2]);
- Ball ball4(glm::vec3(0.0, 0.0, 0.0), textures[3]);
- Ball ball5(glm::vec3(0.0, 0.0, 0.0), textures[4]);
- Ball ball6(glm::vec3(0.0, 0.0, 0.0), textures[5]);
- Ball ball7(glm::vec3(0.0, 0.0, 0.0), textures[6]);
- Ball ball8(glm::vec3(0.0, 0.0, 0.0), textures[7]);
- Ball ball9(glm::vec3(0.0, 0.0, 0.0), textures[8]);
- Ball ball10(glm::vec3(0.0, 0.0, 0.0), textures[9]);
- Ball ball11(glm::vec3(0.0, 0.0, 0.0), textures[10]);
- Ball ball12(glm::vec3(0.0, 0.0, 0.0), textures[11]);
- Ball ball13(glm::vec3(0.0, 0.0, 0.0), textures[12]);
- Ball ball14(glm::vec3(0.0, 0.0, 0.0), textures[13]);
- Ball ball15(glm::vec3(0.0, 0.0, 0.0), textures[14]);
- Ball ball16(glm::vec3(0.0, 0.0, 0.0), textures[15]);
- int elemNum = 0;
- for (int i = 0; i < 16; i++) {
- if (i == 0) {
- modelPos[i] = modelPos[i] + glm::vec3(0.0f, 0.0f, 0.0f);
- cout << "First" << endl;
- }
- if (i > 0 && i < 5) {
- modelPos[i] = modelPos[i - 1] + glm::vec3(2.1f, 0.0f, 0.0f);
- cout << "Second loop" << endl;
- cout << "Ball number" << i << " is on coordinates " << modelPos[i].x << ", " << modelPos[i].z << endl;
- }
- if (i > 4 && i < 9) {
- modelPos[i] = modelPos[i - 5] + glm::vec3(1.1f, 0.0f, -2.1f);
- cout << "Third loop" << endl;
- cout << "Ball number" << i << " is on coordinates " << modelPos[i].x << ", " << modelPos[i].z << endl;
- }
- if (i > 8 && i < 12) {
- modelPos[i] = modelPos[i - 4] + glm::vec3(1.1f, 0.0f, -2.1f);
- cout << "Fourth loop" << endl;
- cout << "Ball number" << i << " is on coordinates " << modelPos[i].x << ", " << modelPos[i].z << endl;
- }
- if (i == 12 || i == 13) {
- modelPos[i] = modelPos[i - 3] + glm::vec3(1.1f, 0.0f, -2.1f);
- cout << "Fifth loop" << endl;
- cout << "Ball number" << i << " is on coordinates " << modelPos[i].x << ", " << modelPos[i].z << endl;
- }
- if (i == 14) {
- modelPos[i] = modelPos[i - 2] + glm::vec3(1.1f, 0.0f, -2.1f);
- cout << "Ball number" << i << " is on coordinates " << modelPos[i].x << ", " << modelPos[i].z << endl;
- }
- }
- ball1.ballPos = modelPos[0];
- ball1.makeSphere();
- ball1.loadTexture();
- ballCollection.push_back(ball1);
- ball2.ballPos = modelPos[1];
- ball2.makeSphere();
- ball2.loadTexture();
- ballCollection.push_back(ball2);
- ball3.ballPos = modelPos[2];
- ball3.makeSphere();
- ball3.loadTexture();
- ballCollection.push_back(ball3);
- ball4.ballPos = modelPos[3];
- ball4.makeSphere();
- ball4.loadTexture();
- ballCollection.push_back(ball4);
- ball5.ballPos = modelPos[4];
- ball5.makeSphere();
- ball5.loadTexture();
- ballCollection.push_back(ball5);
- ball6.ballPos = modelPos[5];
- ball6.makeSphere();
- ball6.loadTexture();
- ballCollection.push_back(ball6);
- ball7.ballPos = modelPos[6];
- ball7.makeSphere();
- ball7.loadTexture();
- ballCollection.push_back(ball7);
- ball8.ballPos = modelPos[7];
- ball8.makeSphere();
- ball8.loadTexture();
- ballCollection.push_back(ball8);
- ball9.ballPos = modelPos[8];
- ball9.makeSphere();
- ball9.loadTexture();
- ballCollection.push_back(ball9);
- ball10.makeSphere();
- ball10.loadTexture();
- ball10.ballPos = modelPos[9];
- ballCollection.push_back(ball10);
- ball11.makeSphere();
- ball11.loadTexture();
- ball11.ballPos = modelPos[10];
- ballCollection.push_back(ball11);
- ball12.ballPos = modelPos[11];
- ball12.makeSphere();
- ball12.loadTexture();
- ballCollection.push_back(ball12);
- ball13.makeSphere();
- ball13.loadTexture();
- ball13.ballPos = modelPos[12];
- ballCollection.push_back(ball13);
- ball14.makeSphere();
- ball14.loadTexture();
- ball14.ballPos = modelPos[13];
- ballCollection.push_back(ball14);
- ball15.makeSphere();
- ball15.loadTexture();
- ball15.ballPos = modelPos[14];
- ballCollection.push_back(ball15);
- modelPos[15] = glm::vec3{ 0.0f, 0.0f, 20.0f };
- Ball white(modelPos[15], textures[15]);
- white.makeSphere();
- white.loadTexture();
- ballCollection.push_back(white);
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement