mirror of
https://github.com/OpenSpace/OpenSpace.git
synced 2026-01-06 11:39:49 -06:00
Using gridgeometry to render planetmesh
This commit is contained in:
@@ -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<unsigned int> triangleElements;
|
||||
std::vector<glm::vec4> 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();
|
||||
|
||||
@@ -32,6 +32,7 @@
|
||||
#include <openspace/util/updatestructures.h>
|
||||
|
||||
#include <modules/planetbrowsing/rendering/geometry.h>
|
||||
#include <modules/planetbrowsing/rendering/gridgeometry.h>
|
||||
#include <modules/planetbrowsing/rendering/distanceswitch.h>
|
||||
#include <modules/planetbrowsing/rendering/planetmesh.h>
|
||||
|
||||
@@ -59,7 +60,9 @@ namespace openspace {
|
||||
private:
|
||||
std::unique_ptr<ghoul::opengl::ProgramObject> _programObject;
|
||||
|
||||
std::unique_ptr<Geometry> _testGeometry;
|
||||
//std::unique_ptr<Geometry> _testGeometry;
|
||||
GridGeometry _grid;
|
||||
|
||||
|
||||
properties::IntProperty _rotation;
|
||||
|
||||
|
||||
Reference in New Issue
Block a user