1st version volume render finished, with multiple data sets

This commit is contained in:
Jonathan Fransson
2019-05-17 16:01:40 -06:00
parent 3000c14056
commit 319546b243
23 changed files with 224 additions and 18 deletions

View File

@@ -7,7 +7,7 @@
local assetHelper = asset.require('util/asset_helper')
local transforms = asset.require("scene/solarsystem/planets/earth/transforms")
local earthRadius = 6371000
local earthRadius = 2 * 10946320;
local volume = {
Identifier = "DebrisVolume",

View File

@@ -0,0 +1,38 @@
-- This asset requires OpenSpace to be built with the OPENSPACE_MODULE_VOLUME enabled
-- Before using this asset,
-- the volume data itself needs to be generated,
-- using the task 'data/tasks/volume/debristasks/generate_debris_volume.task'
local assetHelper = asset.require('util/asset_helper')
local transforms = asset.require("scene/solarsystem/planets/earth/transforms")
local earthRadius = 2 * 9762650;
local volume = {
Identifier = "DebrisVolume1",
Parent = transforms.EarthInertial.Identifier,
Renderable = {
Type = "RenderableTimeVaryingVolume",
SourceDirectory = asset.localResource("generated1"),
TransferFunction = asset.localResource("transferfunction.txt"),
StepSize = 0.01,
MinValue = 0,
MaxValue = 1,
GridType = "Cartesian",
SecondsBefore = 50*365*24*60*60,
SecondsAfter = 50*365*24*60*60
},
GUI = {
Path = "/Volumes"
},
Transform = {
Scale = {
Type = "StaticScale",
Scale = earthRadius -- do not multiply this. That will not show real representation.
}
}
}
local objects = { volume }
assetHelper.registerSceneGraphNodes(asset, objects)

View File

@@ -0,0 +1,38 @@
-- This asset requires OpenSpace to be built with the OPENSPACE_MODULE_VOLUME enabled
-- Before using this asset,
-- the volume data itself needs to be generated,
-- using the task 'data/tasks/volume/debristasks/generate_debris_volume.task'
local assetHelper = asset.require('util/asset_helper')
local transforms = asset.require("scene/solarsystem/planets/earth/transforms")
local earthRadius = 2 * 8540390;
local volume = {
Identifier = "DebrisVolume2",
Parent = transforms.EarthInertial.Identifier,
Renderable = {
Type = "RenderableTimeVaryingVolume",
SourceDirectory = asset.localResource("generated2"),
TransferFunction = asset.localResource("transferfunction.txt"),
StepSize = 0.01,
MinValue = 0,
MaxValue = 1,
GridType = "Cartesian",
SecondsBefore = 50*365*24*60*60,
SecondsAfter = 50*365*24*60*60
},
GUI = {
Path = "/Volumes"
},
Transform = {
Scale = {
Type = "StaticScale",
Scale = earthRadius -- do not multiply this. That will not show real representation.
}
}
}
local objects = { volume }
assetHelper.registerSceneGraphNodes(asset, objects)

View File

@@ -0,0 +1,38 @@
-- This asset requires OpenSpace to be built with the OPENSPACE_MODULE_VOLUME enabled
-- Before using this asset,
-- the volume data itself needs to be generated,
-- using the task 'data/tasks/volume/debristasks/generate_debris_volume.task'
local assetHelper = asset.require('util/asset_helper')
local transforms = asset.require("scene/solarsystem/planets/earth/transforms")
local earthRadius = 2 * 7847140;
local volume = {
Identifier = "DebrisVolume3",
Parent = transforms.EarthInertial.Identifier,
Renderable = {
Type = "RenderableTimeVaryingVolume",
SourceDirectory = asset.localResource("generated3"),
TransferFunction = asset.localResource("transferfunction.txt"),
StepSize = 0.01,
MinValue = 0,
MaxValue = 1,
GridType = "Cartesian",
SecondsBefore = 50*365*24*60*60,
SecondsAfter = 50*365*24*60*60
},
GUI = {
Path = "/Volumes"
},
Transform = {
Scale = {
Type = "StaticScale",
Scale = earthRadius -- do not multiply this. That will not show real representation.
}
}
}
local objects = { volume }
assetHelper.registerSceneGraphNodes(asset, objects)

View File

@@ -0,0 +1,38 @@
-- This asset requires OpenSpace to be built with the OPENSPACE_MODULE_VOLUME enabled
-- Before using this asset,
-- the volume data itself needs to be generated,
-- using the task 'data/tasks/volume/debristasks/generate_debris_volume.task'
local assetHelper = asset.require('util/asset_helper')
local transforms = asset.require("scene/solarsystem/planets/earth/transforms")
local earthRadius = 2 * 8035460;
local volume = {
Identifier = "DebrisVolume4",
Parent = transforms.EarthInertial.Identifier,
Renderable = {
Type = "RenderableTimeVaryingVolume",
SourceDirectory = asset.localResource("generated4"),
TransferFunction = asset.localResource("transferfunction.txt"),
StepSize = 0.01,
MinValue = 0,
MaxValue = 1,
GridType = "Cartesian",
SecondsBefore = 50*365*24*60*60,
SecondsAfter = 50*365*24*60*60
},
GUI = {
Path = "/Volumes"
},
Transform = {
Scale = {
Type = "StaticScale",
Scale = earthRadius -- do not multiply this. That will not show real representation.
}
}
}
local objects = { volume }
assetHelper.registerSceneGraphNodes(asset, objects)

View File

@@ -1 +1 @@
return {Dimensions={3.200000E1,3.200000E1,3.200000E1},GridType="Cartesian",LowerDomainBound={-0.500000E0,-0.500000E0,-0.500000E0},MaxValue=3.000000E0,MinValue=0,Time="2018-05-04T00:00:00.000",UpperDomainBound={0.500000E0,0.500000E0,0.500000E0}}
return {Dimensions={1.600000E1,1.600000E1,1.600000E1},GridType="Cartesian",LowerDomainBound={-0.500000E0,-0.500000E0,-0.500000E0},MaxValue=1.000000E0,MinValue=0,Time="2018-05-04T00:00:00.000",UpperDomainBound={0.500000E0,0.500000E0,0.500000E0}}

View File

@@ -0,0 +1 @@
return {Dimensions={1.600000E1,1.600000E1,1.600000E1},GridType="Cartesian",LowerDomainBound={-0.500000E0,-0.500000E0,-0.500000E0},MaxValue=3.500000E1,MinValue=0,Time="2018-05-04T00:00:00.000",UpperDomainBound={0.500000E0,0.500000E0,0.500000E0}}

View File

@@ -0,0 +1 @@
return {Dimensions={1.600000E1,1.600000E1,1.600000E1},GridType="Cartesian",LowerDomainBound={-0.500000E0,-0.500000E0,-0.500000E0},MaxValue=4.000000E0,MinValue=0,Time="2018-05-04T00:00:00.000",UpperDomainBound={0.500000E0,0.500000E0,0.500000E0}}

View File

@@ -0,0 +1 @@
return {Dimensions={1.600000E1,1.600000E1,1.600000E1},GridType="Cartesian",LowerDomainBound={-0.500000E0,-0.500000E0,-0.500000E0},MaxValue=8.000000E0,MinValue=0,Time="2018-05-04T00:00:00.000",UpperDomainBound={0.500000E0,0.500000E0,0.500000E0}}

View File

@@ -0,0 +1 @@
return {Dimensions={1.600000E1,1.600000E1,1.600000E1},GridType="Cartesian",LowerDomainBound={-0.500000E0,-0.500000E0,-0.500000E0},MaxValue=1.100000E1,MinValue=0,Time="2018-05-04T00:00:00.000",UpperDomainBound={0.500000E0,0.500000E0,0.500000E0}}

View File

@@ -1,10 +1,12 @@
return {{
Type = "GenerateDebrisVolumeTask",
Dimensions = {32, 32, 32},
Dimensions = {16, 16, 16},
LowerDomainBound = {-0.5, -0.5, -0.5},
UpperDomainBound = {0.5, 0.5, 0.5},
InputPath = "D:/Openspace/sync/url/satellite_tle_data_IndianASATtestDebris(10018654073589624780)/files/2019-006.txt",
InputPath = "C:/Users/Jonathan/Documents/exjobb/OpenSpace/sync/url/satellite_tle_data_BreezeMBreakup(18391204735368316775)/files/2012-044.txt",
StartTime = "2018-05-04T00:00:00",
RawVolumeOutput = "${DATA}/assets/scene/solarsystem/planets/earth/satellites/debris/volume/generated/singleDebris.rawvolume",
DictionaryOutput = "${DATA}/assets/scene/solarsystem/planets/earth/satellites/debris/volume/generated/singleDebris.dictionary"
}}
-- C:\Users\Jonathan\Documents\exjobb\OpenSpace\sync\url\satellite_tle_data_BreezeMBreakup(18391204735368316775)\files

View File

@@ -0,0 +1,12 @@
return {{
Type = "GenerateDebrisVolumeTask",
Dimensions = {16, 16, 16},
LowerDomainBound = {-0.5, -0.5, -0.5},
UpperDomainBound = {0.5, 0.5, 0.5},
InputPath = "C:/Users/Jonathan/Documents/exjobb/OpenSpace/sync/url/satellite_tle_data_FengyunDebris(17139759358359376863)/files/1999-025.txt",
StartTime = "2018-05-04T00:00:00",
RawVolumeOutput = "${DATA}/assets/scene/solarsystem/planets/earth/satellites/debris/volume/generated1/singleDebris.rawvolume",
DictionaryOutput = "${DATA}/assets/scene/solarsystem/planets/earth/satellites/debris/volume/generated1/singleDebris.dictionary"
}}
-- C:\Users\Jonathan\Documents\exjobb\OpenSpace\sync\url\satellite_tle_data_BreezeMBreakup(18391204735368316775)\files

View File

@@ -0,0 +1,12 @@
return {{
Type = "GenerateDebrisVolumeTask",
Dimensions = {16, 16, 16},
LowerDomainBound = {-0.5, -0.5, -0.5},
UpperDomainBound = {0.5, 0.5, 0.5},
InputPath = "C:/Users/Jonathan/Documents/exjobb/OpenSpace/sync/url/satellite_tle_data_IndianASATtestDebris(10018654073589624780)/files/2019-006.txt",
StartTime = "2018-05-04T00:00:00",
RawVolumeOutput = "${DATA}/assets/scene/solarsystem/planets/earth/satellites/debris/volume/generated2/singleDebris.rawvolume",
DictionaryOutput = "${DATA}/assets/scene/solarsystem/planets/earth/satellites/debris/volume/generated2/singleDebris.dictionary"
}}
-- C:\Users\Jonathan\Documents\exjobb\OpenSpace\sync\url\satellite_tle_data_BreezeMBreakup(18391204735368316775)\files

View File

@@ -0,0 +1,12 @@
return {{
Type = "GenerateDebrisVolumeTask",
Dimensions = {16, 16, 16},
LowerDomainBound = {-0.5, -0.5, -0.5},
UpperDomainBound = {0.5, 0.5, 0.5},
InputPath = "C:/Users/Jonathan/Documents/exjobb/OpenSpace/sync/url/satellite_tle_data_Iridium33Debris(10708435089634408069)/files/iridium-33-debris.txt",
StartTime = "2018-05-04T00:00:00",
RawVolumeOutput = "${DATA}/assets/scene/solarsystem/planets/earth/satellites/debris/volume/generated3/singleDebris.rawvolume",
DictionaryOutput = "${DATA}/assets/scene/solarsystem/planets/earth/satellites/debris/volume/generated3/singleDebris.dictionary"
}}
-- C:\Users\Jonathan\Documents\exjobb\OpenSpace\sync\url\satellite_tle_data_BreezeMBreakup(18391204735368316775)\files

View File

@@ -0,0 +1,12 @@
return {{
Type = "GenerateDebrisVolumeTask",
Dimensions = {16, 16, 16},
LowerDomainBound = {-0.5, -0.5, -0.5},
UpperDomainBound = {0.5, 0.5, 0.5},
InputPath = "C:/Users/Jonathan/Documents/exjobb/OpenSpace/sync/url/satellite_tle_data_Kosmos2251Debris(14362705017065532804)/files/cosmos-2251-debris.txt",
StartTime = "2018-05-04T00:00:00",
RawVolumeOutput = "${DATA}/assets/scene/solarsystem/planets/earth/satellites/debris/volume/generated4/singleDebris.rawvolume",
DictionaryOutput = "${DATA}/assets/scene/solarsystem/planets/earth/satellites/debris/volume/generated4/singleDebris.dictionary"
}}
-- C:\Users\Jonathan\Documents\exjobb\OpenSpace\sync\url\satellite_tle_data_BreezeMBreakup(18391204735368316775)\files

View File

@@ -22,7 +22,6 @@
* OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. *
****************************************************************************************/
#include <modules/space/tasks/generatedebrisvolumetask.h>
#include <ghoul/logging/logmanager.h>
#include <modules/volume/rawvolume.h>
#include <modules/volume/rawvolumemetadata.h>
@@ -395,9 +394,9 @@ std::vector<glm::dvec3> generatePositions(int numberOfPositions) {
std::vector<glm::dvec3> positions;
float radius = 700000; // meter
int degreeStep = static_cast<int>(360 / numberOfPositions);
float degreeStep = 360 / numberOfPositions;
for(int i=0 ; i<= 360 ; i += degreeStep){
for(int i=0 ; i<= 360 ; i == degreeStep){
glm::dvec3 singlePosition = glm::dvec3(radius* sin(i), radius*cos(i), 0.0);
positions.push_back(singlePosition);
}
@@ -433,9 +432,10 @@ int getIndexFromPosition(glm::dvec3 position, glm::uvec3 dim, float maxApogee){
,position.y + maxApogee
,position.z + maxApogee);
glm::uvec3 coordinateIndex = glm::uvec3(static_cast<int>(newPosition.x * dim.x / (2*(maxApogee + epsilon))),
static_cast<int>(newPosition.y * dim.y / (2 * (maxApogee + epsilon))),
static_cast<int>(newPosition.z * dim.z / (2 * (maxApogee + epsilon))));
glm::uvec3 coordinateIndex = glm::uvec3(static_cast<int>(newPosition.x * dim.x / (2 * (maxApogee + epsilon))),
static_cast<int>(newPosition.y * dim.y / (2 * (maxApogee + epsilon))),
static_cast<int>(newPosition.z * dim.z / (2 * (maxApogee + epsilon))));
return coordinateIndex.z * (dim.x * dim.y) + coordinateIndex.y * dim.x + coordinateIndex.x;
}
@@ -499,6 +499,7 @@ void GenerateDebrisVolumeTask::perform(const Task::ProgressCallback& progressCal
const int size = _dimensions.x *_dimensions.y *_dimensions.z;
int *densityArrayp = new int[size]();
float maxApogee = getMaxApogee(_TLEDataVector);
LINFO(fmt::format("maxApp: {} ", maxApogee));
//densityArrayp = mapDensityToVoxels(densityArrayp, generatedPositions, _dimensions, maxApogee);
densityArrayp = mapDensityToVoxels(densityArrayp, startPositionBuffer, _dimensions, maxApogee);
@@ -516,6 +517,11 @@ void GenerateDebrisVolumeTask::perform(const Task::ProgressCallback& progressCal
// glm::vec3(cell) / glm::vec3(_dimensions) * domainSize;
float value = getDensityAt(cell, densityArrayp, rawVolume); // (coord)
//LINFO(fmt::format("EachVoxel: {} ", value));
// if((cell.x + cell.y + cell.z) % 8 == 0)
// value = 1;
// else
// value = 0;
rawVolume.set(cell, value);
minVal = std::min(minVal, value);
@@ -584,12 +590,6 @@ documentation::Documentation GenerateDebrisVolumeTask::documentation() {
Optional::No,
"Input path to the TLE-data",
},
{
KeyStartTime,
new StringAnnotationVerifier("A valid timestamp"),
Optional::No,
"First timestep of volume",
},
{
KeyRawVolumeOutput,
new StringAnnotationVerifier("A valid filepath"),