diff --git a/data/assets/bastille-mas-model.scene b/data/assets/bastille-mas-model.scene index ee9c4697e8..2ef3d4b19c 100644 --- a/data/assets/bastille-mas-model.scene +++ b/data/assets/bastille-mas-model.scene @@ -34,17 +34,15 @@ local Keybindings = { { Key = "F2", Name = "Show Flux Value Legend", - --Command = "openspace.asset.add('C:/Users/chrad171/openspace/OpenSpace/data/assets/scene/solarsystem/sun/streamnodeslegend')", Command = "openspace.setPropertyValueSingle('ScreenSpace.Legendstreamnodes.Enabled', true);", - Documentation = "Shows or hides the legend image", + Documentation = "Show the legend image", Local = true }, { Key = "F3", Name = "Show Flux Value Legend", - --Command = "openspace.asset.remove('C:/Users/chrad171/openspace/OpenSpace/data/assets/scene/solarsystem/sun/streamnodeslegend')", Command = "openspace.setPropertyValueSingle('ScreenSpace.Legendstreamnodes.Enabled', false);", - Documentation = "Shows or hides the legend image", + Documentation = "Hides the legend image", Local = true }, { diff --git a/data/assets/scene/solarsystem/sun/streamnodeslegend.asset b/data/assets/scene/solarsystem/sun/streamnodeslegend.asset index 18a0bbc06b..9e4e287897 100644 --- a/data/assets/scene/solarsystem/sun/streamnodeslegend.asset +++ b/data/assets/scene/solarsystem/sun/streamnodeslegend.asset @@ -23,7 +23,8 @@ local legend = { }; openspace.addScreenSpaceRenderable(legend) -openspace.setPropertyValueSingle('ScreenSpace.Legendstreamnodes.CartesianPosition', {-1.457630,-0.033900,-2.000000}); +openspace.setPropertyValueSingle('ScreenSpace.Legendstreamnodes.CartesianPosition', {0.915250,-0.033900,-1.278690}); +openspace.setPropertyValueSingle('ScreenSpace.Legendstreamnodes.Rotation', {0.000000,0.000000,0.5}); openspace.setPropertyValueSingle('ScreenSpace.Legendstreamnodes.Scale', 0.037560); openspace.setPropertyValueSingle('ScreenSpace.Legendstreamnodes.Enabled', false); diff --git a/modules/fieldlinessequence/rendering/renderablestreamnodes.cpp b/modules/fieldlinessequence/rendering/renderablestreamnodes.cpp index 547afcd297..bfe39e4ea9 100644 --- a/modules/fieldlinessequence/rendering/renderablestreamnodes.cpp +++ b/modules/fieldlinessequence/rendering/renderablestreamnodes.cpp @@ -194,19 +194,19 @@ namespace { "Select nodes to skip depending on Radius." }; constexpr openspace::properties::Property::PropertyInfo DistanceMethodInfo = { - "DistanceMethod", - "Decide how to check distance", + "distanceMethod", + "Distance Method", "Deciding how to check distance." }; constexpr openspace::properties::Property::PropertyInfo DistanceplanetInfo = { - "Distanceplanet", - "Decide what planet to check distance to", + "distanceplanet", + "Distance Planet", "Deciding what planet to check distance to." }; constexpr openspace::properties::Property::PropertyInfo DistanceThresholdInfo = { "distancePlanetThreshold", - "Deciding how far the values will start to ", - "Enhance the size of nodes dependent on distance to planet" + "Threshold for distance between planet", + "Enhance the size of nodes dependent on distance to planet." }; enum class SourceFileType : int { @@ -288,7 +288,7 @@ namespace openspace { , _pDefaultNodeSkip(DefaultNodeSkipInfo, 1, 1, 100) , _pFluxNodeskipThreshold(FluxNodeskipThresholdInfo, 0, -20, 10) , _pRadiusNodeSkipThreshold(RadiusNodeSkipThresholdInfo, 0.f, 0.f, 5.f) - , _pDistanceThreshold(DistanceThresholdInfo, 0.0f, 0.0f, 1000000000000.0f) + , _pDistanceThreshold(DistanceThresholdInfo, 0.0f, 0.0f, 700000000000.0f) { @@ -976,7 +976,6 @@ namespace openspace { const double triggerTime = Time::convertTime(timeString); LDEBUG("timestring " + timeString); _startTimes.push_back(triggerTime); - } } void RenderableStreamNodes::updateActiveTriggerTimeIndex(double currentTime) { @@ -1009,19 +1008,12 @@ namespace openspace { _shaderProgram->setUniform("modelViewProjection", data.camera.sgctInternal.projectionMatrix() * glm::mat4(modelViewMat)); - const std::string earth = "Earth"; - SceneGraphNode* earthnode = sceneGraphNode(earth); - glm::vec3 earthpos = earthnode->worldPosition(); - const std::string Sun = "Sun"; - SceneGraphNode* SunNode = sceneGraphNode(Sun); - glm::dvec3 Sunpos = SunNode->worldPosition(); - //LDEBUG("Sunsposx: " + std::to_string(Sunpos.x) + "earthpos x: " + std::to_string(earthpos.x)); - // earthpos = earthpos - Sunpos; - //LDEBUG("Suns position: " + std::to_string(Sunpos.x) + ", " + std::to_string(Sunpos.y) + ", " + std::to_string(Sunpos.z)); - glm::vec3 earthpos2 = glm::vec3(94499869340.f, -115427843118.f, 11212075887.f); - //LDEBUG("earthpos x: " + std::to_string(earthpos.x) + " ," + std::to_string(earthpos.y) + ", " + std::to_string(earthpos.z)); - // Flow/Particles + + glm::vec3 earthPos = glm::vec3(94499869340, -115427843118, 11212075887.3); + //earthPos : 136665866240.000000, 44111921152.000000, -49989160960.000000 + // Jon : 94499869340, -115427843118, 11212075887.3 + _shaderProgram->setUniform(_uniformCache.streamColor, _pStreamColor); _shaderProgram->setUniform(_uniformCache.nodeSize, _pNodeSize); _shaderProgram->setUniform(_uniformCache.nodeSizeLargerFlux, _pNodeSizeLargerFlux); @@ -1038,7 +1030,7 @@ namespace openspace { _shaderProgram->setUniform("NodeskipFluxThreshold", _pFluxNodeskipThreshold); _shaderProgram->setUniform("NodeskipRadiusThreshold", _pRadiusNodeSkipThreshold); _shaderProgram->setUniform("fluxColorAlpha", _pFluxColorAlpha); - _shaderProgram->setUniform("earthPos", earthpos2); + _shaderProgram->setUniform("earthPos", earthPos); _shaderProgram->setUniform("DistanceThreshold", _pDistanceThreshold); _shaderProgram->setUniform("DistanceMethod", _pDistancemethod); diff --git a/modules/fieldlinessequence/rendering/renderablestreamnodes.h b/modules/fieldlinessequence/rendering/renderablestreamnodes.h index 4204ef8ce6..272b22365f 100644 --- a/modules/fieldlinessequence/rendering/renderablestreamnodes.h +++ b/modules/fieldlinessequence/rendering/renderablestreamnodes.h @@ -200,7 +200,7 @@ namespace openspace { properties::FloatProperty _pNodeSize; // Size of nodes for larger flux properties::FloatProperty _pNodeSizeLargerFlux; - // Threshold from earth to decide the distance for which the nodesize gets larger. + // Threshold from earth to decide the distance for which the nodeSize gets larger. properties::FloatProperty _pDistanceThreshold; /// Line width for the line rendering part diff --git a/modules/fieldlinessequence/shaders/streamnodes_vs.glsl b/modules/fieldlinessequence/shaders/streamnodes_vs.glsl index 92e5c586f2..3e13709bcf 100644 --- a/modules/fieldlinessequence/shaders/streamnodes_vs.glsl +++ b/modules/fieldlinessequence/shaders/streamnodes_vs.glsl @@ -208,36 +208,28 @@ void main() { else{ gl_PointSize = nodeSizeLargerFlux; } - - vec3 vertexPosRelativetoEarth; - vertexPosRelativetoEarth.x = in_position.x; // + earthPos.x; - vertexPosRelativetoEarth.y = in_position.y;// + earthPos.y; - vertexPosRelativetoEarth.z = in_position.z;// + earthPos.z; - // + in_position; + if(DistanceMethod == 0){ - if(distance(earthPos, vertexPosRelativetoEarth) < DistanceThreshold){ - //if(earthPos.x - vertexPosRelativetoEarth.x < DistanceThreshold){ - gl_PointSize = 10; - } + if(distance(earthPos, in_position) < DistanceThreshold){ + gl_PointSize = 10; + } } else if(DistanceMethod == 1){ - if(abs(earthPos.x - vertexPosRelativetoEarth.x) < DistanceThreshold){ - gl_PointSize = 10; + if(distance(earthPos.x, in_position.x) < DistanceThreshold){ + gl_PointSize = 10; + } } + else if(DistanceMethod == 2){ + if(distance(earthPos.y, in_position.y) < DistanceThreshold){ + gl_PointSize = 10; + } + } + else if(DistanceMethod == 3){ + if(distance(earthPos.z, in_position.z) < DistanceThreshold){ + gl_PointSize = 10; + } } - else if(DistanceMethod == 2){ - if(abs(earthPos.y - vertexPosRelativetoEarth.y) < DistanceThreshold){ - gl_PointSize = 10; - } - } - - else if(DistanceMethod == 3){ - if(abs(earthPos.z - vertexPosRelativetoEarth.z) < DistanceThreshold){ - gl_PointSize = 10; - } - } - vec4 position_in_meters = vec4(in_position, 1); vec4 positionClipSpace = modelViewProjection * position_in_meters; //vs_gPosition = vec4(modelViewTransform * dvec4(in_point_position, 1));