From 6a03d8986127b9123b4cc55da6e559d86f3c4913 Mon Sep 17 00:00:00 2001 From: Karl Bladin Date: Fri, 1 Apr 2016 13:27:11 -0400 Subject: [PATCH] Using gridgeometry to render planetmesh --- modules/planetbrowsing/rendering/planetmesh.cpp | 8 +++++++- modules/planetbrowsing/rendering/planetmesh.h | 5 ++++- 2 files changed, 11 insertions(+), 2 deletions(-) diff --git a/modules/planetbrowsing/rendering/planetmesh.cpp b/modules/planetbrowsing/rendering/planetmesh.cpp index 254d63c2eb..77c95a8f2a 100644 --- a/modules/planetbrowsing/rendering/planetmesh.cpp +++ b/modules/planetbrowsing/rendering/planetmesh.cpp @@ -51,6 +51,7 @@ namespace openspace { PlanetMesh::PlanetMesh(const ghoul::Dictionary& dictionary) : DistanceSwitch() , _programObject(nullptr) + , _grid(10, 10, Geometry::Positions::Yes, Geometry::TextureCoordinates::No, Geometry::Normals::No) , _rotation("rotation", "Rotation", 0, 0, 360) { std::string name; @@ -67,6 +68,9 @@ namespace openspace { // Mainly for debugging purposes @AA addProperty(_rotation); + _grid.initialize(); + + /* // Create a simple triangle for testing the geometry std::vector triangleElements; std::vector trianglePositions; @@ -87,6 +91,7 @@ namespace openspace { _testGeometry->setVertexPositions(trianglePositions); _testGeometry->initialize(); + */ } PlanetMesh::~PlanetMesh() { @@ -157,7 +162,8 @@ namespace openspace { glCullFace(GL_BACK); // render - _testGeometry->drawUsingActiveProgram(); + // _testGeometry->drawUsingActiveProgram(); + _grid.drawUsingActiveProgram(); // disable shader _programObject->deactivate(); diff --git a/modules/planetbrowsing/rendering/planetmesh.h b/modules/planetbrowsing/rendering/planetmesh.h index b7881d1c72..e32bbaf9bf 100644 --- a/modules/planetbrowsing/rendering/planetmesh.h +++ b/modules/planetbrowsing/rendering/planetmesh.h @@ -32,6 +32,7 @@ #include #include +#include #include #include @@ -59,7 +60,9 @@ namespace openspace { private: std::unique_ptr _programObject; - std::unique_ptr _testGeometry; + //std::unique_ptr _testGeometry; + GridGeometry _grid; + properties::IntProperty _rotation;