HeightMap.h 489 B

12345678910111213141516171819202122232425262728293031323334353637
  1. #pragma once
  2. #include <string>
  3. #include <vector>
  4. #include <GL/freeglut.h>
  5. class HeightMap
  6. {
  7. private:
  8. int height;
  9. int width;
  10. GLuint imageIndex;
  11. int scale = 1;
  12. public:
  13. HeightMap(const std::string &file);
  14. ~HeightMap();
  15. void Draw();
  16. void GetHeigth(float x, float z);
  17. void SetTexture(const std::string &file);
  18. struct Vertex {
  19. float x;
  20. float y;
  21. float z;
  22. float normalX;
  23. float normalY;
  24. float normalZ;
  25. float texX;
  26. float texY;
  27. };
  28. std::vector<Vertex> vertices;
  29. };