From 54809c6376ee21a8d1955207b1cbc126351fa53d Mon Sep 17 00:00:00 2001 From: michal Date: Mon, 20 Oct 2014 18:29:55 -0400 Subject: [PATCH] Pluto geometry artefacts commit. --- .../rendering/renderablewavefrontobject.h | 15 ++------ include/openspace/util/constants.h | 1 - scripts/default_startup.lua | 6 ++-- src/rendering/renderablepath.cpp | 1 + src/rendering/renderabletrail.cpp | 4 +-- src/rendering/renderablewavefrontobject.cpp | 35 ++++++++----------- src/util/powerscaledsphere.cpp | 2 +- 7 files changed, 23 insertions(+), 41 deletions(-) diff --git a/include/openspace/rendering/renderablewavefrontobject.h b/include/openspace/rendering/renderablewavefrontobject.h index c0370d1a25..755b5958b9 100644 --- a/include/openspace/rendering/renderablewavefrontobject.h +++ b/include/openspace/rendering/renderablewavefrontobject.h @@ -83,19 +83,8 @@ private: glm::dmat3 _stateMatrix; // might need this - std::string _target; - - ///NH FOV - - GLuint _vaoFOV = 10; - GLuint _vboFOV = 11; - GLuint _iboFOV = 12; - - unsigned int _isizeFOV; - unsigned int _vsizeFOV; - std::vector _varrayFOV; - int *_iarrayFOV; - + std::string _source; + std::string _destination; }; diff --git a/include/openspace/util/constants.h b/include/openspace/util/constants.h index 49e8787045..9c8b0ce40d 100644 --- a/include/openspace/util/constants.h +++ b/include/openspace/util/constants.h @@ -37,7 +37,6 @@ namespace configurationmanager { const std::string keyStartupScript = "StartupScripts"; const std::string keySpiceTimeKernel = "SpiceKernel.Time"; const std::string keySpiceLeapsecondKernel = "SpiceKernel.LeapSecond"; - const std::string keySpiceNewHorizons = "SpiceKernel.NewHorizons"; } // namespace configurationmanager namespace scenegraph { diff --git a/scripts/default_startup.lua b/scripts/default_startup.lua index 99a37cac97..fa714ec348 100644 --- a/scripts/default_startup.lua +++ b/scripts/default_startup.lua @@ -1,10 +1,10 @@ --openspace.setPropertyValue('Earth.renderable.colorTexture', '${OPENSPACE_DATA}/modules/mars/textures/mars.png') -openspace.time.setTime("2007-02-26T17:00:00") ---openspace.time.setTime("2006-08-22T20:00:00") +--openspace.time.setTime("2006-02-26T17:00:00") +openspace.time.setTime("2006-08-22T20:00:00") --openspace.time.setDeltaTime(200000.0) --openspace.time.setDeltaTime(5000.00) -openspace.time.setDeltaTime(1000) +openspace.time.setDeltaTime(10) --openspace.time.setDeltaTime(30000.0) -- print(openspace.time.currentTimeUTC()) diff --git a/src/rendering/renderablepath.cpp b/src/rendering/renderablepath.cpp index c61fbea9f7..25b4963f07 100644 --- a/src/rendering/renderablepath.cpp +++ b/src/rendering/renderablepath.cpp @@ -77,6 +77,7 @@ namespace openspace{ void RenderablePath::fullYearSweep(){ double lightTime = 0.0; SpiceManager::ref().getETfromDate("2006 jan 20 19:00:00", _time); + // -------------------------------------- ^ this has to be simulation start-time, not passed in here though -- double et2 = 0; //SpiceManager::ref().getETfromDate("2008 apr 01 00:00:00", et2); diff --git a/src/rendering/renderabletrail.cpp b/src/rendering/renderabletrail.cpp index 2238e4e920..a4127d4e60 100644 --- a/src/rendering/renderabletrail.cpp +++ b/src/rendering/renderabletrail.cpp @@ -171,8 +171,8 @@ bool RenderableTrail::initialize(){ completeSuccess &= (_texture != nullptr); _startTrail; - //SpiceManager::ref().getETfromDate("2006 jan 19 20:00:00", _startTrail); - SpiceManager::ref().getETfromDate("2007 feb 26 17:00:00", _startTrail); + SpiceManager::ref().getETfromDate("2006 Aug 22 17:00:00", _startTrail); + //SpiceManager::ref().getETfromDate("2007 feb 26 17:00:00", _startTrail); _dtEt = _startTrail; fullYearSweep(); diff --git a/src/rendering/renderablewavefrontobject.cpp b/src/rendering/renderablewavefrontobject.cpp index a5bda0e212..d578070fb8 100644 --- a/src/rendering/renderablewavefrontobject.cpp +++ b/src/rendering/renderablewavefrontobject.cpp @@ -42,6 +42,8 @@ namespace { const std::string _loggerCat = "RenderableWavefrontObject"; + const std::string keySource = "Rotation.Source"; + const std::string keyDestination = "Rotation.Destination"; } namespace openspace { @@ -51,28 +53,25 @@ RenderableWavefrontObject::RenderableWavefrontObject(const ghoul::Dictionary& di , _programObject(nullptr) , _fovProgram(nullptr) , _texture(nullptr) + , _mode(GL_TRIANGLES) { std::string name; - bool success = dictionary.getValue(constants::scenegraphnode::keyName, name); - assert(success); + assert(dictionary.getValue(constants::scenegraphnode::keyName, name)); std::string path; - dictionary.getValue(constants::scenegraph::keyPathModule, path); + assert(dictionary.getValue(constants::scenegraph::keyPathModule, path)); std::string texturePath = ""; if (dictionary.hasKey("Textures.Color")) { - dictionary.getValue("Textures.Color", texturePath); + assert(dictionary.getValue("Textures.Color", texturePath)); _colorTexturePath = path + "/" + texturePath; } addProperty(_colorTexturePath); _colorTexturePath.onChange(std::bind(&RenderableWavefrontObject::loadTexture, this)); - _mode = GL_TRIANGLES; - std::string file; - dictionary.getValue(constants::renderablewavefrontobject::keyObjFile, file); - + assert(dictionary.getValue(constants::renderablewavefrontobject::keyObjFile, file)); const std::string filename = FileSys.absolutePath(file); std::cout << "OBJECT LOADER FILENAME : " << filename << std::endl; @@ -86,11 +85,10 @@ RenderableWavefrontObject::RenderableWavefrontObject(const ghoul::Dictionary& di }else { LERROR("Did not find file..\n"); } - + assert(dictionary.getValue(keySource , _source)); + assert(dictionary.getValue(keyDestination , _destination)); } - - void RenderableWavefrontObject::loadObj(const char *filename){ // temporary int vertexSize = 0; @@ -137,7 +135,7 @@ void RenderableWavefrontObject::loadObj(const char *filename){ _vsize = indicesSize; // float arrays - float *tempVertexArray = new float[vertexSize];// vertexSize*sizeof(float)); + float *tempVertexArray = new float[vertexSize]; float *tempVertexNormalArray = new float[vertexNormalSize]; float *tempVertexTextureArray = new float[vertexTextureSize]; _varray = new Vertex[_vsize]; @@ -224,7 +222,7 @@ void RenderableWavefrontObject::loadObj(const char *filename){ vertexIndex = _iarray[m] * 3; _iarray[m] = m; - _varray[m].location[3] = 7; + _varray[m].location[3] = 7; // I need to set this proper at some point. int q = 0; while (q < 3){ _varray[m].location[q] = tempVertexArray[vertexIndex + q]; @@ -346,8 +344,8 @@ void RenderableWavefrontObject::render(const RenderData& data) tmp[i][j] = _stateMatrix[i][j]; } } - transform *= tmp; - transform *= rot_x; + //transform *= tmp; + //transform *= rot_x; //transform *= rot_y; glm::mat4 modelview = data.camera.viewMatrix()*data.camera.modelMatrix(); @@ -378,18 +376,13 @@ void RenderableWavefrontObject::render(const RenderData& data) name.resize(32); std::vector bounds; glm::dvec3 boresight; - - bool found = openspace::SpiceManager::ref().getFieldOfView("NH_LORRI", shape, name, boresight, bounds); - glm::vec4 a(boresight, 1); - a = transform*a; - //std::cout << a[0] << " " << a[1] << " " << a[2] << std::endl; } void RenderableWavefrontObject::update(const UpdateData& data) { glm::dvec3 position(0, 0, 0); // set spice-orientation in accordance to timestamp - openspace::SpiceManager::ref().getPositionTransformMatrix("NH_SPACECRAFT", "GALACTIC", data.time, _stateMatrix); + openspace::SpiceManager::ref().getPositionTransformMatrix(_source, _destination, data.time, _stateMatrix); } diff --git a/src/util/powerscaledsphere.cpp b/src/util/powerscaledsphere.cpp index 27c274c7cc..8990fbede4 100644 --- a/src/util/powerscaledsphere.cpp +++ b/src/util/powerscaledsphere.cpp @@ -40,7 +40,7 @@ PowerScaledSphere::PowerScaledSphere(const PowerScaledScalar& radius, int segmen : _vaoID(0) , _vBufferID(0) , _iBufferID(0) - , _mode(GL_TRIANGLES) + , _mode(GL_LINES) , _isize(6 * segments * segments) , _vsize((segments + 1) * (segments + 1)) , _varray(new Vertex[_vsize])