nucLeaRsc2

Untitled

Nov 19th, 2014
243
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C++ 1.22 KB | None | 0 0
  1. void Grid::createGrid(){
  2.  
  3.     Object3D *cube;
  4.     //vector <Point3D*> vertices;
  5.     //vector <Face*> faces;
  6.     //vector <int> contour;
  7.  
  8.  
  9.     for (int i = 0; i < this->getRows(); i++){
  10.         for (int j = 0; j < this->getColumns(); j++){
  11.            
  12.             vector <Point3D*> vertices;
  13.             vector <Face*> faces;
  14.             vector <int> contour;
  15.  
  16.  
  17.             //vertices.clear();
  18.             vertices.push_back(new Point3D(i * Grid::gridSize, 0, j * Grid::gridSize));
  19.             vertices.push_back(new Point3D((i + 1) * Grid::gridSize, 0, j * gridSize));
  20.             vertices.push_back(new Point3D((i + 1) * Grid::gridSize, 0, (j+1) * Grid::gridSize));
  21.             vertices.push_back(new Point3D(i * Grid::gridSize, 0, (j+1) * Grid::gridSize));
  22.  
  23.  
  24.             //fata gridului
  25.             //contour.clear();
  26.             contour.push_back(0);
  27.             contour.push_back(1);
  28.             contour.push_back(2);
  29.             contour.push_back(3);
  30.             faces.push_back(new Face(contour));
  31.  
  32.  
  33.             cube = new Object3D(vertices, faces, Color(0, 0, 0), false);
  34.             this->gridFoundation.push_back(cube);
  35.            
  36.             DrawingWindow::addObject3D_to_Visual2D(cube, v2d1);
  37.  
  38.             /* Aplic transformarea izometrica pe elementul nou */
  39.             GameConstants::makeIsometricMatrix();
  40.             Transform3D::translateMatrix(0.015f, 0, 0.015f);
  41.             Transform3D::applyTransform(cube);
  42.  
  43.         }
  44.     }
Advertisement
Add Comment
Please, Sign In to add comment