Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- void Grid::createGrid(){
- Object3D *cube;
- //vector <Point3D*> vertices;
- //vector <Face*> faces;
- //vector <int> contour;
- for (int i = 0; i < this->getRows(); i++){
- for (int j = 0; j < this->getColumns(); j++){
- vector <Point3D*> vertices;
- vector <Face*> faces;
- vector <int> contour;
- //vertices.clear();
- vertices.push_back(new Point3D(i * Grid::gridSize, 0, j * Grid::gridSize));
- vertices.push_back(new Point3D((i + 1) * Grid::gridSize, 0, j * gridSize));
- vertices.push_back(new Point3D((i + 1) * Grid::gridSize, 0, (j+1) * Grid::gridSize));
- vertices.push_back(new Point3D(i * Grid::gridSize, 0, (j+1) * Grid::gridSize));
- //fata gridului
- //contour.clear();
- contour.push_back(0);
- contour.push_back(1);
- contour.push_back(2);
- contour.push_back(3);
- faces.push_back(new Face(contour));
- cube = new Object3D(vertices, faces, Color(0, 0, 0), false);
- this->gridFoundation.push_back(cube);
- DrawingWindow::addObject3D_to_Visual2D(cube, v2d1);
- /* Aplic transformarea izometrica pe elementul nou */
- GameConstants::makeIsometricMatrix();
- Transform3D::translateMatrix(0.015f, 0, 0.015f);
- Transform3D::applyTransform(cube);
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment