treegen.h 804 B

123456789101112131415161718192021
  1. #ifndef TREEGEN_H
  2. #define TREEGEN_H
  3. #include <iostream>
  4. #include <vector>
  5. #include <fstream>
  6. #include <string>
  7. #include <glm/glm.hpp>
  8. void grassBlade(std::vector<glm::vec3> &vertices, glm::vec3 origin);
  9. void outputTree(std::string filename = "");
  10. void outputForest(std::string filename = "");
  11. void outputVertices(std::vector<glm::vec3> vertices, std::string fileName = "", std::string color = "brown");
  12. void outputGrass(std::string filename) ;
  13. void fractalTree3d(std::vector<glm::vec3> &vertices, glm::vec3 origin, glm::vec3 direction,
  14. float rad, int n, int max, float distancePerDiv, float baseAngle = 45.f,
  15. std::vector<glm::vec3> base = {}, // Can't use a reference, because we need an empty default
  16. int maxBranches = 4);
  17. #endif // TREEGEN_H