Update pointcloud examples to conform with new example structure (#3213)

* Update pointcloud examples to conform with new example structure and add some new ones

* Update name, GUI path and add title to top comment to match the decided format

* Rename base examples to Basic, as agreed

* Clarify TODO comment about broken label rotation

---------

Co-authored-by: Alexander Bock <alexander.bock@liu.se>
Co-authored-by: Ylva Selling <ylva.selling@gmail.com>
This commit is contained in:
Emma Broman
2024-04-30 13:33:18 +02:00
committed by GitHub
parent 359cf9950e
commit 86d1b2d8a6
30 changed files with 668 additions and 685 deletions
@@ -0,0 +1,70 @@
-- Advanced Color Mapping
-- This example shows almost all the available settings for the color mapping used
-- for point clouds. This includes handling missing data values, using
-- separate colors for values outside the data range used for the color mapping, as well
-- as setting the default parameter and range.
local colormaps = asset.require("util/default_colormaps")
local Node = {
Identifier = "RenderablePointCloud_Example_AdvancedColorMapping",
Renderable = {
Type = "RenderablePointCloud",
File = asset.resource("../data/dummydata.csv"),
Coloring = {
ColorMapping = {
-- Use white-to-black color map
File = colormaps.Sequential.Greys,
-- Invert the color map so it goes from dark to bright (black-to-white) instead
-- of from bright to dark
Invert = true,
-- Set the default choice of parameter and value range explicitly. Values
-- outside this range will be given special colors
Parameter = "normaldist_withMissing",
ValueRange = { -0.25, 0.25 },
-- Show missing data values, so we can show these in a specific color
ShowMissingData = true,
-- Color for missing data points
NoDataColor = { 1.0, 0.0, 0.0, 1.0 },
-- Color for point with values above the given range. If not set, or if
-- UseAboveRangeColor is false, the color will be set to the last value
-- in the color map (as per default)
AboveRangeColor = { 0.0, 1.0, 0.0, 1.0 },
-- Color for point with values below the given range. If not set, or if
-- UseAboveRangeColor is false, the color will be set to the first value
-- in the color map (as per default)
BelowRangeColor = { 0.0, 0.0, 1.0, 1.0 },
-- Some other parameters that can be set are the following (these are all the
-- default values):
-- If true, completely hide all values outside the range
HideValuesOutsideRange = false,
-- Toggle whether the above range color should be used
UseAboveRangeColor = true,
-- Toggle whether the below range color should be used
UseBelowRangeColor = true
}
},
SizeSettings = {
-- Reduce the size of the point a little bit so that they don't overlap so much
ScaleFactor = 0.5
}
},
GUI = {
Name = "Advanced Color Mapping",
Path = "/Examples/RenderablePointCloud/Advanced",
Description = [[Example of a point cloud where the range is set explicitly and
specific colors are used for values outside the range, as well as for missing
data values.]]
}
}
asset.onInitialize(function()
openspace.addSceneGraphNode(Node)
end)
asset.onDeinitialize(function()
openspace.removeSceneGraphNode(Node)
end)
@@ -0,0 +1,53 @@
-- Custom Data Mapping
-- Example of a point cloud with a custom data mapping. The X, Y, and Z position are
-- mapped to other columns in the dataset. The data mapping also includes some settings
-- for missing data values and columns to exclude when loading the dataset.
local colormaps = asset.require("util/default_colormaps")
local Node = {
Identifier = "RenderablePointCloud_Example_DataMapping",
Renderable = {
Type = "RenderablePointCloud",
File = asset.resource("../data/dummydata.csv"),
DataMapping = {
-- Using the DataMapping, we can specify the X, Y and Z values of the point
-- positions to be set by any value in the dataset, without changing the dataset
-- used for the rendering
X = "a",
Y = "b",
Z = "a",
-- It is also possible to specify a numeric value that corresponds to missing
-- values in the dataset. These will be interpreted as NaN values
MissingDataValue = 29,
-- And some column that we do not want to include in the loading. Here we can for
-- example skip the regular position columns
ExcludeColumns = { "x", "y", "z" }
},
-- Interpret values as Parsec rather than meter. The values in the a and b columns
-- are much smaller than the x, y and z
Unit = "pc",
-- To show the values corresponding to missing values, use a color map and show
-- missing data values in a specific color
Coloring = {
ColorMapping = {
File = colormaps.Uniform.Magma,
ShowMissingData = true,
NoDataColor = { 1.0, 0.0, 0.0, 1.0 }
}
}
},
GUI = {
Name = "Custom Data Mapping",
Path = "/Examples/RenderablePointCloud/Advanced"
}
}
asset.onInitialize(function()
openspace.addSceneGraphNode(Node)
end)
asset.onDeinitialize(function()
openspace.removeSceneGraphNode(Node)
end)
@@ -0,0 +1,69 @@
-- Fading
-- Example of a point cloud with distance-based fading.
local Node = {
Identifier = "RenderablePointCloud_Example_Fading",
Renderable = {
Type = "RenderablePointCloud",
File = asset.resource("../data/dummydata.csv"),
Coloring = {
FixedColor = { 0.0, 0.3, 1.0 }
},
Fading = {
-- Control at what distance the points fade in. The points will be invisible
-- when the camera is closer than the first value, and fully visible when the
-- camera is further away then the last value. In-between they will linearly
-- fade in or out
FadeInDistances = { 150000000.0, 350000000.0 }
}
},
GUI = {
Name = "Fading",
Path = "/Examples/RenderablePointCloud/Advanced",
Description = [[Example of a point cloud with distance-based fading (the points
are visible when the camera reaches a certain distance away from the origin)]]
}
}
local Node_Invert = {
Identifier = "RenderablePointCloud_Example_FadingInverted",
-- Rotate to not overlap with the other dataset
Transform = {
Rotation = {
Type = "StaticRotation",
Rotation = { 0, 0, -0.5 * math.pi }
}
},
Renderable = {
Type = "RenderablePointCloud",
File = asset.resource("../data/dummydata.csv"),
Coloring = {
FixedColor = { 1.0, 0.3, 0.0 }
},
Fading = {
-- Use the same fade distances, but invert the fading so that the points are
-- visible when the camera is closer to the origin that the first value, and
-- invisible when further away than the last value
FadeInDistances = { 150000000.0, 350000000.0 },
Invert = true
}
},
GUI = {
Name = "Fading (Inverted)",
Path = "/Examples/RenderablePointCloud/Advanced",
Description = [[Example of a point cloud with inverted distance-based fading
(the points are visible when the camera is close to the origin, and invisible
when further away)]]
}
}
asset.onInitialize(function()
openspace.addSceneGraphNode(Node)
openspace.addSceneGraphNode(Node_Invert)
end)
asset.onDeinitialize(function()
openspace.removeSceneGraphNode(Node_Invert)
openspace.removeSceneGraphNode(Node)
end)
@@ -0,0 +1,84 @@
-- Labels
-- This example creates a point cloud with labels created from a column in the dataset
-- or from a separate .labels file.
local Node = {
Identifier = "RenderablePointCloud_Example_Labels",
Renderable = {
Type = "RenderablePointCloud",
File = asset.resource("../data/dummydata.csv"),
Coloring = {
FixedColor = { 0.0, 1.0, 0.3 }
},
DataMapping = {
-- When loading labels from a CSV file, we need to provide information about
-- which column corresponds to the name to be used for the labels (this is
-- not required for SPECK files)
Name = "number_withNan"
},
-- Add a unit to interpret the points to be in kilometers rather than meters
Unit = "Km",
-- Add some labels. We also need to enable them for them to be visible.
-- The positions and text of the labels will be set based on the information
-- in the CSV file
Labels = {
Enabled = true,
-- Give the labels a size that looks good
Size = 7.5
}
},
GUI = {
Name = "Labels",
Path = "/Examples/RenderablePointCloud/Advanced"
}
}
-- @TODO (2024-04-30, emmbr) These labels are not correctly oriented towards the camera.
-- This is a known bug waiting to be fixed (related Github issues are #2493, #1605,
-- and #1266).
local Node_LabelsFile = {
Identifier = "RenderablePointCloud_Example_LabelsFile",
-- Rotate to not overlap with the other dataset
Transform = {
Rotation = {
Type = "StaticRotation",
Rotation = { 0, 0, -0.5 * math.pi }
}
},
Renderable = {
Type = "RenderablePointCloud",
File = asset.resource("../data/dummydata.csv"),
Coloring = {
FixedColor = { 0.0, 0.3, 1.0 }
},
-- Add a unit to interpret the points to be in kilometers rather than meters
Unit = "Km",
-- Also load a label file with the positions of the label (in this case they are the
-- same as in the CSV file, but that is not always the case)
Labels = {
Enabled = true,
File = asset.resource("../data/dummydata.label"),
Size = 7.5,
-- When we add an explicit label file we also have to specify the unit, if it is
-- different than meters
Unit = "Km"
}
},
GUI = {
Name = "Labels - Custom File",
Path = "/Examples/RenderablePointCloud/Advanced",
Description = [[Example of a point cloud with labels, created from a .label file]]
}
}
asset.onInitialize(function()
openspace.addSceneGraphNode(Node)
openspace.addSceneGraphNode(Node_LabelsFile)
end)
asset.onDeinitialize(function()
openspace.removeSceneGraphNode(Node)
openspace.removeSceneGraphNode(Node_LabelsFile)
end)
@@ -0,0 +1,95 @@
-- Multi-textured Points
-- Example of point clouds where multiple textures are used for the points,
-- based on information in the dataset. The dataset may be either CSV or Speck format.
--
-- Load data from a CSV file. This requires additional information to be provided through
-- the DataMapping:
-- 1) Which column in the dataset that corresponds to the texture, and
-- 2) a separate file that maps that value to a texture file.
local Node = {
Identifier = "RenderablePointCloud_Example_MultiTextured_CSV",
Renderable = {
Type = "RenderablePointCloud",
File = asset.resource("../data/multitextured_csv/textured_points.csv"),
DataMapping = {
-- The name of the column in the CSV file that corresponds to the texture (should
-- be an integer)
TextureColumn = "texture",
-- A Texture mapping file that provides information about which value/index
-- corresponds to which texture file
TextureMapFile = asset.resource("../data/multitextured_csv/texturemap.tmap")
},
Texture = {
-- Where to find the texture files (in this case, in the OpenSpace data folder)
Folder = openspace.absPath("${DATA}")
},
UseAdditiveBlending = false
},
GUI = {
Name = "Multi-Textured",
Path = "/Examples/RenderablePointCloud/Advanced"
}
}
-- Interpolated
-- Multi-texturing works also for interpolated point clouds. Here, we let the same
-- dataset as used above be interpreted as representing only two points, with a different
-- texture. Note that the textures will be set based on the first two data items and will
-- not be changed during interpolation
local Node_Interpolated = {
Identifier = "RenderablePointCloud_Example_MultiTextured_Interpolated",
Renderable = {
Type = "RenderableInterpolatedPoints",
File = asset.resource("../data/multitextured_csv/textured_points.csv"),
NumberOfObjects = 2,
DataMapping = {
TextureColumn = "texture",
TextureMapFile = asset.resource("../data/multitextured_csv/texturemap.tmap")
},
Texture = {
Folder = openspace.absPath("${DATA}")
},
UseAdditiveBlending = false
},
GUI = {
Name = "Multi-Textured (with interpolation)",
Path = "/Examples/RenderablePointCloud/Advanced"
}
}
-- Load data from a Speck file. This allows storing all data in one single file, including
-- the texture mapping) Note that we disable this scene graph node per default here, as it
-- shows the same information as the CSV version
local Node_Speck = {
Identifier = "RenderablePointCloud_Example_MultiTextured_Speck",
Renderable = {
Type = "RenderablePointCloud",
Enabled = false,
-- When loading multi-texture information from a speck file, we do not need a
-- DataMapping entry - all information is in the file
File = asset.resource("../data/multitextured_speck/textures_points.speck"),
Texture = {
-- However, we do still need to specify where the textures are located
Folder = openspace.absPath("${DATA}")
},
UseAdditiveBlending = false
},
GUI = {
Name = "Multi-Textured (Speck file)",
Path = "/Examples/RenderablePointCloud/Advanced"
}
}
asset.onInitialize(function()
openspace.addSceneGraphNode(Node)
openspace.addSceneGraphNode(Node_Interpolated)
openspace.addSceneGraphNode(Node_Speck)
end)
asset.onDeinitialize(function()
openspace.removeSceneGraphNode(Node_Speck)
openspace.removeSceneGraphNode(Node_Interpolated)
openspace.removeSceneGraphNode(Node)
end)
@@ -0,0 +1,104 @@
# A dummy dataset with an xyz position and some random data columns.
# The last two columns has data values with either missing values or
# Nan values (which can be handled seprately when color mapping)
x,y,z,a,b,normaldist_withMissing,number_withNan
13428000,26239000,45870000,-3.226548224,33.95773276,-0.357778948,29
14727000,45282000,10832000,45.05941924,-106.0395917,,29
24999000,28370000,19911000,-70.58906931,154.1851656,-0.167961782,Nan
26539000,36165000,39582000,-13.3663358,71.79484733,0.113536778,9
49056000,24775000,14626000,21.42870979,-115.6088304,0.125551095,37
43965000,21472000,18760000,65.07055022,-56.36880466,0.172981386,18
15661000,28429000,16965000,76.15826514,125.3163407,,40
25046000,36006000,49453000,-22.31710915,137.4486786,0.447921314,28
13797000,34811000,18825000,-79.40300933,74.05580595,-0.02379786,12
13879000,14824000,41472000,-30.93548431,-8.755047834,-0.041777813,50
11481000,20480000,25925000,75.51244012,178.1377926,-0.044396255,0
45032000,16606000,23537000,37.38766828,175.5064508,-0.449674816,13
14395000,34940000,21968000,-31.6863061,-116.6587323,-0.09741961,30
15945000,21478000,29536000,-53.01226701,59.18196347,0.304142338,30
13458000,19017000,18542000,8.72692265,80.65872957,,45
45302000,15732000,34369000,-85.57061714,124.6890481,-0.364449145,20
15559000,36269000,18160000,-4.975784243,-156.8789425,-0.012893853,22
16552000,14570000,39763000,-39.2579671,75.22960824,-0.281792015,Nan
11353000,13410000,38311000,8.610608538,-36.43103437,-0.196021206,9
12383000,49302000,33539000,69.26506588,-109.0830926,-0.147483079,34
44302000,21387000,23434000,16.14574541,78.81171702,0.115624185,5
43107000,14206000,24728000,37.57233254,142.6103028,,Nan
49320000,43878000,24240000,-39.10527498,149.2751575,-0.086246397,29
37519000,40514000,16409000,-24.14434437,157.2871976,-0.071946303,12
37202000,40122000,42551000,-79.88824934,-124.089513,0.375414362,31
12783000,11757000,25348000,-11.83866388,118.2423568,-0.243289139,Nan
39621000,30560000,15929000,75.8365484,-95.18288548,-0.399996182,37
10937000,15183000,21413000,-32.40573,-157.8337361,-0.202310776,39
39411000,12532000,44006000,34.67409469,-83.29512212,,Nan
47905000,25552000,28902000,36.19437814,52.25734185,,32
28426000,45268000,27886000,-70.843469,-63.7321218,0.112287307,45
15026000,45897000,23911000,-89.01161062,10.16376248,-0.00400866,Nan
24625000,14844000,12837000,88.91663258,169.8003753,-0.151728888,5
46304000,21144000,24421000,-41.58069299,59.63971512,-0.371030712,48
29558000,10724000,27312000,9.663492403,-71.18121738,0.344402457,Nan
49636000,27202000,24626000,59.46440387,-92.91431055,0.26256468,31
38603000,23794000,41040000,70.45128929,-67.84861911,-0.184920666,48
37336000,21742000,40982000,-15.69131418,134.6754731,0.078786176,15
35128000,38725000,25244000,2.279345664,34.91612867,0.091098807,44
30419000,33591000,39512000,-56.16030331,133.9105282,-0.590693487,8
18665000,11189000,45438000,-45.68302316,-85.35524485,0.046936859,26
15442000,36392000,16074000,81.4389588,-56.70945587,0.038804669,5
43378000,27900000,38748000,-74.35249265,-133.1884413,0.429053963,17
44424000,19982000,13528000,-81.19709235,49.49364675,0.115926289,47
42733000,15383000,28933000,75.17020088,-11.11330632,0.127627239,32
40144000,46822000,29588000,-81.25577073,-135.8002245,0.346061193,33
16927000,38232000,43931000,-80.97022269,157.7565432,-0.096039391,39
38910000,36030000,38003000,-37.79005665,-1.5474944,0.107402594,11
48340000,38510000,39290000,21.94846638,-112.6129615,0.230803493,3
17258000,45665000,27152000,80.73726495,-31.33714033,-0.079079307,10
48363000,39701000,11905000,11.83766221,-69.99777106,-0.002514692,3
27660000,29370000,26029000,8.179457229,147.7719143,-0.006520509,31
47106000,30527000,17038000,73.00898959,9.988869939,0.797492967,5
10471000,37521000,35398000,57.46145065,-29.5045034,-0.261313809,39
27774000,44082000,40036000,78.47974779,-4.998179635,0.437739286,24
46887000,20413000,36649000,51.11098102,-136.3276432,0.237434245,41
10093000,46706000,19187000,-58.41750426,-157.9933447,0.275586609,45
49093000,36514000,38499000,-55.41355694,150.177605,0.576467955,21
48945000,49826000,23225000,-63.91174083,-177.7191007,0.475443991,Nan
26852000,28926000,32243000,-77.854481,116.9006581,,1
34219000,34787000,30801000,-62.32990484,23.24232366,0.089523916,40
31075000,30369000,36898000,-77.78314619,38.69526825,-0.046423443,7
28135000,21412000,25552000,-7.411565773,-88.65122734,0.258690016,Nan
13347000,15980000,43094000,74.71054756,-37.32614369,,7
26928000,31159000,16653000,-32.74503199,146.7695347,0.576290488,34
12364000,14374000,43646000,28.70641859,-92.35199713,-0.059531367,16
38991000,49388000,48534000,56.70658222,8.014973542,-0.173400177,30
17180000,14935000,11680000,-45.39957586,102.5726701,0.16285705,1
27666000,29337000,44778000,89.4063742,-79.68068618,0.044140443,41
13660000,11108000,37986000,57.03349279,7.98684928,0.066242706,24
36910000,10252000,41657000,-9.906961203,21.79114496,-0.378241692,6
21785000,20095000,14903000,77.49612237,-84.68789002,-0.071118836,16
33363000,42124000,39814000,-64.47776113,-30.79591997,0.371115832,35
42758000,48892000,44762000,42.39782697,-32.55868099,-0.146011285,1
16590000,22098000,28515000,-36.90992927,-55.27481385,-0.203981239,27
26448000,45475000,33361000,64.22197115,146.6687002,-0.026210913,1
41182000,23927000,25075000,-81.55929754,137.9213773,0.042229126,10
49801000,15636000,39883000,-89.22857667,159.9681504,0.035529624,15
32725000,13037000,49874000,-55.17873101,61.01413612,0.519438664,43
31130000,16471000,41939000,-45.36963748,-156.5100924,0.245045969,22
19599000,37119000,26468000,-26.58523044,174.7731562,-0.210527713,22
30024000,23097000,14711000,44.31464407,150.7894846,-0.041347399,45
39567000,48586000,49391000,1.721781555,156.1687027,,31
46249000,28249000,32393000,-13.3221674,-176.0644697,-0.108879159,30
12180000,20488000,46288000,36.02858732,30.43526779,-0.099205446,47
29659000,40098000,45152000,72.15373455,62.01511311,,46
41026000,19309000,15845000,-38.63636224,145.9569745,-0.083266866,32
47146000,39852000,26666000,35.2426196,-33.97130609,-0.650089141,7
39958000,46945000,11789000,-68.31344333,172.4154216,0.001713968,37
25921000,13147000,22257000,-15.89505915,-150.39693,0.165178387,37
28892000,28329000,49094000,-58.72206735,-157.3776844,-0.228068143,48
29563000,48312000,45703000,86.78718085,179.1386066,-0.146072441,49
46127000,46582000,13462000,39.98033674,-164.152123,-0.081830298,17
23268000,24051000,48652000,-43.61767649,83.51428751,-0.106824408,45
22163000,26901000,28702000,51.04347167,169.7632117,0.052782471,31
46968000,17027000,25787000,-73.8664022,2.915300454,-0.028069047,22
24148000,44640000,15422000,8.379412685,101.9542853,-0.049339904,14
11566000,26486000,11735000,-36.78748293,-129.8960512,,Nan
11063000,38883000,16772000,-65.43894139,105.6607872,,7
43081000,16718000,45813000,-2.464830259,87.07999887,-0.24057898,40
1 # A dummy dataset with an xyz position and some random data columns.
2 # The last two columns has data values with either missing values or
3 # Nan values (which can be handled seprately when color mapping)
4 x,y,z,a,b,normaldist_withMissing,number_withNan
5 13428000,26239000,45870000,-3.226548224,33.95773276,-0.357778948,29
6 14727000,45282000,10832000,45.05941924,-106.0395917,,29
7 24999000,28370000,19911000,-70.58906931,154.1851656,-0.167961782,Nan
8 26539000,36165000,39582000,-13.3663358,71.79484733,0.113536778,9
9 49056000,24775000,14626000,21.42870979,-115.6088304,0.125551095,37
10 43965000,21472000,18760000,65.07055022,-56.36880466,0.172981386,18
11 15661000,28429000,16965000,76.15826514,125.3163407,,40
12 25046000,36006000,49453000,-22.31710915,137.4486786,0.447921314,28
13 13797000,34811000,18825000,-79.40300933,74.05580595,-0.02379786,12
14 13879000,14824000,41472000,-30.93548431,-8.755047834,-0.041777813,50
15 11481000,20480000,25925000,75.51244012,178.1377926,-0.044396255,0
16 45032000,16606000,23537000,37.38766828,175.5064508,-0.449674816,13
17 14395000,34940000,21968000,-31.6863061,-116.6587323,-0.09741961,30
18 15945000,21478000,29536000,-53.01226701,59.18196347,0.304142338,30
19 13458000,19017000,18542000,8.72692265,80.65872957,,45
20 45302000,15732000,34369000,-85.57061714,124.6890481,-0.364449145,20
21 15559000,36269000,18160000,-4.975784243,-156.8789425,-0.012893853,22
22 16552000,14570000,39763000,-39.2579671,75.22960824,-0.281792015,Nan
23 11353000,13410000,38311000,8.610608538,-36.43103437,-0.196021206,9
24 12383000,49302000,33539000,69.26506588,-109.0830926,-0.147483079,34
25 44302000,21387000,23434000,16.14574541,78.81171702,0.115624185,5
26 43107000,14206000,24728000,37.57233254,142.6103028,,Nan
27 49320000,43878000,24240000,-39.10527498,149.2751575,-0.086246397,29
28 37519000,40514000,16409000,-24.14434437,157.2871976,-0.071946303,12
29 37202000,40122000,42551000,-79.88824934,-124.089513,0.375414362,31
30 12783000,11757000,25348000,-11.83866388,118.2423568,-0.243289139,Nan
31 39621000,30560000,15929000,75.8365484,-95.18288548,-0.399996182,37
32 10937000,15183000,21413000,-32.40573,-157.8337361,-0.202310776,39
33 39411000,12532000,44006000,34.67409469,-83.29512212,,Nan
34 47905000,25552000,28902000,36.19437814,52.25734185,,32
35 28426000,45268000,27886000,-70.843469,-63.7321218,0.112287307,45
36 15026000,45897000,23911000,-89.01161062,10.16376248,-0.00400866,Nan
37 24625000,14844000,12837000,88.91663258,169.8003753,-0.151728888,5
38 46304000,21144000,24421000,-41.58069299,59.63971512,-0.371030712,48
39 29558000,10724000,27312000,9.663492403,-71.18121738,0.344402457,Nan
40 49636000,27202000,24626000,59.46440387,-92.91431055,0.26256468,31
41 38603000,23794000,41040000,70.45128929,-67.84861911,-0.184920666,48
42 37336000,21742000,40982000,-15.69131418,134.6754731,0.078786176,15
43 35128000,38725000,25244000,2.279345664,34.91612867,0.091098807,44
44 30419000,33591000,39512000,-56.16030331,133.9105282,-0.590693487,8
45 18665000,11189000,45438000,-45.68302316,-85.35524485,0.046936859,26
46 15442000,36392000,16074000,81.4389588,-56.70945587,0.038804669,5
47 43378000,27900000,38748000,-74.35249265,-133.1884413,0.429053963,17
48 44424000,19982000,13528000,-81.19709235,49.49364675,0.115926289,47
49 42733000,15383000,28933000,75.17020088,-11.11330632,0.127627239,32
50 40144000,46822000,29588000,-81.25577073,-135.8002245,0.346061193,33
51 16927000,38232000,43931000,-80.97022269,157.7565432,-0.096039391,39
52 38910000,36030000,38003000,-37.79005665,-1.5474944,0.107402594,11
53 48340000,38510000,39290000,21.94846638,-112.6129615,0.230803493,3
54 17258000,45665000,27152000,80.73726495,-31.33714033,-0.079079307,10
55 48363000,39701000,11905000,11.83766221,-69.99777106,-0.002514692,3
56 27660000,29370000,26029000,8.179457229,147.7719143,-0.006520509,31
57 47106000,30527000,17038000,73.00898959,9.988869939,0.797492967,5
58 10471000,37521000,35398000,57.46145065,-29.5045034,-0.261313809,39
59 27774000,44082000,40036000,78.47974779,-4.998179635,0.437739286,24
60 46887000,20413000,36649000,51.11098102,-136.3276432,0.237434245,41
61 10093000,46706000,19187000,-58.41750426,-157.9933447,0.275586609,45
62 49093000,36514000,38499000,-55.41355694,150.177605,0.576467955,21
63 48945000,49826000,23225000,-63.91174083,-177.7191007,0.475443991,Nan
64 26852000,28926000,32243000,-77.854481,116.9006581,,1
65 34219000,34787000,30801000,-62.32990484,23.24232366,0.089523916,40
66 31075000,30369000,36898000,-77.78314619,38.69526825,-0.046423443,7
67 28135000,21412000,25552000,-7.411565773,-88.65122734,0.258690016,Nan
68 13347000,15980000,43094000,74.71054756,-37.32614369,,7
69 26928000,31159000,16653000,-32.74503199,146.7695347,0.576290488,34
70 12364000,14374000,43646000,28.70641859,-92.35199713,-0.059531367,16
71 38991000,49388000,48534000,56.70658222,8.014973542,-0.173400177,30
72 17180000,14935000,11680000,-45.39957586,102.5726701,0.16285705,1
73 27666000,29337000,44778000,89.4063742,-79.68068618,0.044140443,41
74 13660000,11108000,37986000,57.03349279,7.98684928,0.066242706,24
75 36910000,10252000,41657000,-9.906961203,21.79114496,-0.378241692,6
76 21785000,20095000,14903000,77.49612237,-84.68789002,-0.071118836,16
77 33363000,42124000,39814000,-64.47776113,-30.79591997,0.371115832,35
78 42758000,48892000,44762000,42.39782697,-32.55868099,-0.146011285,1
79 16590000,22098000,28515000,-36.90992927,-55.27481385,-0.203981239,27
80 26448000,45475000,33361000,64.22197115,146.6687002,-0.026210913,1
81 41182000,23927000,25075000,-81.55929754,137.9213773,0.042229126,10
82 49801000,15636000,39883000,-89.22857667,159.9681504,0.035529624,15
83 32725000,13037000,49874000,-55.17873101,61.01413612,0.519438664,43
84 31130000,16471000,41939000,-45.36963748,-156.5100924,0.245045969,22
85 19599000,37119000,26468000,-26.58523044,174.7731562,-0.210527713,22
86 30024000,23097000,14711000,44.31464407,150.7894846,-0.041347399,45
87 39567000,48586000,49391000,1.721781555,156.1687027,,31
88 46249000,28249000,32393000,-13.3221674,-176.0644697,-0.108879159,30
89 12180000,20488000,46288000,36.02858732,30.43526779,-0.099205446,47
90 29659000,40098000,45152000,72.15373455,62.01511311,,46
91 41026000,19309000,15845000,-38.63636224,145.9569745,-0.083266866,32
92 47146000,39852000,26666000,35.2426196,-33.97130609,-0.650089141,7
93 39958000,46945000,11789000,-68.31344333,172.4154216,0.001713968,37
94 25921000,13147000,22257000,-15.89505915,-150.39693,0.165178387,37
95 28892000,28329000,49094000,-58.72206735,-157.3776844,-0.228068143,48
96 29563000,48312000,45703000,86.78718085,179.1386066,-0.146072441,49
97 46127000,46582000,13462000,39.98033674,-164.152123,-0.081830298,17
98 23268000,24051000,48652000,-43.61767649,83.51428751,-0.106824408,45
99 22163000,26901000,28702000,51.04347167,169.7632117,0.052782471,31
100 46968000,17027000,25787000,-73.8664022,2.915300454,-0.028069047,22
101 24148000,44640000,15422000,8.379412685,101.9542853,-0.049339904,14
102 11566000,26486000,11735000,-36.78748293,-129.8960512,,Nan
103 11063000,38883000,16772000,-65.43894139,105.6607872,,7
104 43081000,16718000,45813000,-2.464830259,87.07999887,-0.24057898,40
@@ -0,0 +1,100 @@
13428000 26239000 45870000 id P0 text Point 0
14727000 45282000 10832000 id P1 text Point 1
24999000 28370000 19911000 id P2 text Point 2
26539000 36165000 39582000 id P3 text Point 3
49056000 24775000 14626000 id P4 text Point 4
43965000 21472000 18760000 id P5 text Point 5
15661000 28429000 16965000 id P6 text Point 6
25046000 36006000 49453000 id P7 text Point 7
13797000 34811000 18825000 id P8 text Point 8
13879000 14824000 41472000 id P9 text Point 9
11481000 20480000 25925000 id P10 text Point 10
45032000 16606000 23537000 id P11 text Point 11
14395000 34940000 21968000 id P12 text Point 12
15945000 21478000 29536000 id P13 text Point 13
13458000 19017000 18542000 id P14 text Point 14
45302000 15732000 34369000 id P15 text Point 15
15559000 36269000 18160000 id P16 text Point 16
16552000 14570000 39763000 id P17 text Point 17
11353000 13410000 38311000 id P18 text Point 18
12383000 49302000 33539000 id P19 text Point 19
44302000 21387000 23434000 id P20 text Point 20
43107000 14206000 24728000 id P21 text Point 21
49320000 43878000 24240000 id P22 text Point 22
37519000 40514000 16409000 id P23 text Point 23
37202000 40122000 42551000 id P24 text Point 24
12783000 11757000 25348000 id P25 text Point 25
39621000 30560000 15929000 id P26 text Point 26
10937000 15183000 21413000 id P27 text Point 27
39411000 12532000 44006000 id P28 text Point 28
47905000 25552000 28902000 id P29 text Point 29
28426000 45268000 27886000 id P30 text Point 30
15026000 45897000 23911000 id P31 text Point 31
24625000 14844000 12837000 id P32 text Point 32
46304000 21144000 24421000 id P33 text Point 33
29558000 10724000 27312000 id P34 text Point 34
49636000 27202000 24626000 id P35 text Point 35
38603000 23794000 41040000 id P36 text Point 36
37336000 21742000 40982000 id P37 text Point 37
35128000 38725000 25244000 id P38 text Point 38
30419000 33591000 39512000 id P39 text Point 39
18665000 11189000 45438000 id P40 text Point 40
15442000 36392000 16074000 id P41 text Point 41
43378000 27900000 38748000 id P42 text Point 42
44424000 19982000 13528000 id P43 text Point 43
42733000 15383000 28933000 id P44 text Point 44
40144000 46822000 29588000 id P45 text Point 45
16927000 38232000 43931000 id P46 text Point 46
38910000 36030000 38003000 id P47 text Point 47
48340000 38510000 39290000 id P48 text Point 48
17258000 45665000 27152000 id P49 text Point 49
48363000 39701000 11905000 id P50 text Point 50
27660000 29370000 26029000 id P51 text Point 51
47106000 30527000 17038000 id P52 text Point 52
10471000 37521000 35398000 id P53 text Point 53
27774000 44082000 40036000 id P54 text Point 54
46887000 20413000 36649000 id P55 text Point 55
10093000 46706000 19187000 id P56 text Point 56
49093000 36514000 38499000 id P57 text Point 57
48945000 49826000 23225000 id P58 text Point 58
26852000 28926000 32243000 id P59 text Point 59
34219000 34787000 30801000 id P60 text Point 60
31075000 30369000 36898000 id P61 text Point 61
28135000 21412000 25552000 id P62 text Point 62
13347000 15980000 43094000 id P63 text Point 63
26928000 31159000 16653000 id P64 text Point 64
12364000 14374000 43646000 id P65 text Point 65
38991000 49388000 48534000 id P66 text Point 66
17180000 14935000 11680000 id P67 text Point 67
27666000 29337000 44778000 id P68 text Point 68
13660000 11108000 37986000 id P69 text Point 69
36910000 10252000 41657000 id P70 text Point 70
21785000 20095000 14903000 id P71 text Point 71
33363000 42124000 39814000 id P72 text Point 72
42758000 48892000 44762000 id P73 text Point 73
16590000 22098000 28515000 id P74 text Point 74
26448000 45475000 33361000 id P75 text Point 75
41182000 23927000 25075000 id P76 text Point 76
49801000 15636000 39883000 id P77 text Point 77
32725000 13037000 49874000 id P78 text Point 78
31130000 16471000 41939000 id P79 text Point 79
19599000 37119000 26468000 id P80 text Point 80
30024000 23097000 14711000 id P81 text Point 81
39567000 48586000 49391000 id P82 text Point 82
46249000 28249000 32393000 id P83 text Point 83
12180000 20488000 46288000 id P84 text Point 84
29659000 40098000 45152000 id P85 text Point 85
41026000 19309000 15845000 id P86 text Point 86
47146000 39852000 26666000 id P87 text Point 87
39958000 46945000 11789000 id P88 text Point 88
25921000 13147000 22257000 id P89 text Point 89
28892000 28329000 49094000 id P90 text Point 90
29563000 48312000 45703000 id P91 text Point 91
46127000 46582000 13462000 id P92 text Point 92
23268000 24051000 48652000 id P93 text Point 93
22163000 26901000 28702000 id P94 text Point 94
46968000 17027000 25787000 id P95 text Point 95
24148000 44640000 15422000 id P96 text Point 96
11566000 26486000 11735000 id P97 text Point 97
11063000 38883000 16772000 id P98 text Point 98
43081000 16718000 45813000 id P99 text Point 99
@@ -0,0 +1,9 @@
# A dummy dataset with an xyz position, some random values and an integer value to
# use for texturing the points
#
# The texture mapping from index to file is handled in another file
x,y,z,a,b,texture
13428000,26239000,45870000,-3.226548224,33.95773276,1
14727000,45282000,10832000,45.05941924,-106.0395917,0
24999000,28370000,19911000,-70.58906931,154.1851656,2
26539000,36165000,39582000,-13.3663358,71.79484733,3
1 # A dummy dataset with an xyz position, some random values and an integer value to
2 # use for texturing the points
3 #
4 # The texture mapping from index to file is handled in another file
5 x,y,z,a,b,texture
6 13428000,26239000,45870000,-3.226548224,33.95773276,1
7 14727000,45282000,10832000,45.05941924,-106.0395917,0
8 24999000,28370000,19911000,-70.58906931,154.1851656,2
9 26539000,36165000,39582000,-13.3663358,71.79484733,3
@@ -0,0 +1,8 @@
# The texture map is a mapping between an index and the name of an image file.
# All the images should be located in the same folder, or the name need to be specified as a path relative
# to a specific folder
0 test3.jpg
1 test2.jpg
2 test.jpg
3 openspace-horiz-logo.png
@@ -0,0 +1,16 @@
# A dummy dataset with an xyz position, some random values and an integer value to
# use for texturing the points
datavar 0 a
datavar 1 b
datavar 2 texture
texturevar 2 # The index of the data column that has the texture data
texture 0 test3.jpg
texture 1 test.jpg
texture 2 test.jpg
texture 3 openspace-horiz-logo.png
13428000 26239000 45870000 -3.226548224 33.95773276 0
14727000 45282000 10832000 45.05941924 -106.0395917 2
24999000 28370000 19911000 -70.58906931 154.1851656 3
26539000 36165000 39582000 -13.3663358 71.79484733 1
@@ -0,0 +1,26 @@
-- Basic (Fixed Color and Size)
-- This example creates a point cloud with a fixed color and default size.
-- All the points will have the same size.
local Node = {
Identifier = "RenderablePointCloud_Example",
Renderable = {
Type = "RenderablePointCloud",
File = asset.resource("data/dummydata.csv"),
Coloring = {
FixedColor = { 0.0, 0.5, 0.0 }
}
},
GUI = {
Name = "Fixed Color and Size",
Path = "/Examples/RenderablePointCloud"
}
}
asset.onInitialize(function()
openspace.addSceneGraphNode(Node)
end)
asset.onDeinitialize(function()
openspace.removeSceneGraphNode(Node)
end)
@@ -0,0 +1,35 @@
-- Color Mapping
-- This example creates a point cloud where the color is set from a color map. All the
-- data column in the dataset will be exposed in the user interface and can be used for
-- color mapping during runtime. The range for the color mapping is set based on the min
-- and max values in the dataset, for each column respoectively.
--
-- Note that the color map is loaded from another asset. This is a utility asset that
-- includes some common color maps for general usage.
local colormaps = asset.require("util/default_colormaps")
local Node = {
Identifier = "RenderablePointCloud_Example_ColorMapped",
Renderable = {
Type = "RenderablePointCloud",
File = asset.resource("data/dummydata.csv"),
Coloring = {
ColorMapping = {
File = colormaps.Uniform.Viridis
}
}
},
GUI = {
Name = "Color Mapped",
Path = "/Examples/RenderablePointCloud"
}
}
asset.onInitialize(function()
openspace.addSceneGraphNode(Node)
end)
asset.onDeinitialize(function()
openspace.removeSceneGraphNode(Node)
end)
@@ -0,0 +1,48 @@
-- Color Mapping with Pre-set Options and Missing Values
-- This example creates a point cloud where the color is set from a color map and the
-- options for parameters to color by are pre-set to a limited number of options,
-- including settings for which range to use. It also includes settings to render
-- missing data values in gray.
--
-- Note that the color map is loaded from another asset. This is a utility asset that
-- includes some common color maps for general usage.
local colormaps = asset.require("util/default_colormaps")
local Node = {
Identifier = "RenderablePointCloud_Example_ColorMapped_More",
Renderable = {
Type = "RenderablePointCloud",
File = asset.resource("data/dummydata.csv"),
Coloring = {
ColorMapping = {
File = colormaps.Uniform.Viridis,
-- Specify which parameters we want to show up in the user interface, as
-- well as what range we want the color mapping to be done based on. If not
-- included, all the columns in the data file would be exposed as options
ParameterOptions = {
{ Key = "number_withNan" }, -- No range => compute min and max
{ Key = "normaldist_withMissing", Range = { -0.5, 0.5 } }
},
-- Also show missing data values in a specific color
ShowMissingData = true,
NoDataColor = { 0.5, 0.5, 0.5, 1.0 }
}
},
SizeSettings = {
ScaleExponent = 6.5
}
},
GUI = {
Name = "Color Mapped with Settings",
Path = "/Examples/RenderablePointCloud"
}
}
asset.onInitialize(function()
openspace.addSceneGraphNode(Node)
end)
asset.onDeinitialize(function()
openspace.removeSceneGraphNode(Node)
end)
@@ -0,0 +1,32 @@
-- Limit Max Size
-- This example creates a point cloud where the size of the points is limited to a
-- given max size. The color is set to a fixed value.
local Node = {
Identifier = "RenderablePointCloud_Example_MaxSize",
Renderable = {
Type = "RenderablePointCloud",
File = asset.resource("data/dummydata.csv"),
Coloring = {
FixedColor = { 0.0, 0.8, 0.8 }
},
-- Set the max size of the points. The larger the "MaxSize" value, the larger the
-- points are allowed to get when moving the camera closer to them
SizeSettings = {
MaxSize = 0.7,
EnableMaxSizeControl = true
}
},
GUI = {
Name = "Max Size",
Path = "/Examples/RenderablePointCloud"
}
}
asset.onInitialize(function()
openspace.addSceneGraphNode(Node)
end)
asset.onDeinitialize(function()
openspace.removeSceneGraphNode(Node)
end)
@@ -0,0 +1,30 @@
-- Draw Point Outline
-- This example creates a point cloud where the points have a colored outline with a
-- given color and thickness (weight).
local Node = {
Identifier = "RenderablePointCloud_Example_Outline",
Renderable = {
Type = "RenderablePointCloud",
File = asset.resource("data/dummydata.csv"),
Coloring = {
EnableOutline = true,
OutlineColor = { 0.2, 0.2, 1.0 },
OutlineWeight = 0.1
},
-- It might be desired to disable additive blending when using an outline
UseAdditiveBlending = false
},
GUI = {
Name = "Outlined",
Path = "/Examples/RenderablePointCloud"
}
}
asset.onInitialize(function()
openspace.addSceneGraphNode(Node)
end)
asset.onDeinitialize(function()
openspace.removeSceneGraphNode(Node)
end)
@@ -0,0 +1,33 @@
-- Point Size / Scaling
-- This example creates a point cloud where the size of the points is set by entering a
-- a scale exponent. This makes it so that the points will be given a world-scale size of
-- 10 to the power of the provided scale exponent.
local Node = {
Identifier = "RenderablePointCloud_Example_Scaled",
Renderable = {
Type = "RenderablePointCloud",
File = asset.resource("data/dummydata.csv"),
Coloring = {
FixedColor = { 0.0, 0.0, 0.8 }
},
SizeSettings = {
-- We set the exponent for the scale explicitly, to a value that
-- gives the points a suitable size based on their world-space coordinates
ScaleExponent = 6.5
}
},
GUI = {
Name = "Point Size / Scaling",
Path = "/Examples/RenderablePointCloud",
Description = "Point cloud with configured point size"
}
}
asset.onInitialize(function()
openspace.addSceneGraphNode(Node)
end)
asset.onDeinitialize(function()
openspace.removeSceneGraphNode(Node)
end)
@@ -0,0 +1,40 @@
-- Point Size from Data
-- This example creates a point cloud where the size of the points is computed based on
-- a column in the dataset
local Node = {
Identifier = "RenderablePointCloud_Example_ScaledFromData",
Renderable = {
Type = "RenderablePointCloud",
File = asset.resource("data/dummydata.csv"),
Coloring = {
FixedColor = { 0.5, 0.5, 0.0 }
},
SizeSettings = {
SizeMapping = {
-- The options for the columns that the points can be scaled by. The first
-- alternative in the list is chosen per default
ParameterOptions = { "a", "b" },
-- Specify which option we want to use for size mapping at start up. Here we
-- use the last of the provided options rather than the first one, which is
-- otherwise used by default
Parameter = "b"
},
-- The size mapping can be used together with other scale parameters, such as a
-- scale exponent or scale factor
ScaleExponent = 4.8
}
},
GUI = {
Name = "Size from Data",
Path = "/Examples/RenderablePointCloud"
}
}
asset.onInitialize(function()
openspace.addSceneGraphNode(Node)
end)
asset.onDeinitialize(function()
openspace.removeSceneGraphNode(Node)
end)
@@ -0,0 +1,36 @@
-- Textured
-- This example creates a point cloud using a texture to render each point.
--
-- Note that other color related settings, like color mapping, can still be applied.
-- The color will then be multiplied with the texture color.
local Node = {
Identifier = "RenderablePointCloud_Example_Textured",
Renderable = {
Type = "RenderablePointCloud",
File = asset.resource("data/dummydata.csv"),
Texture = {
-- The path to the texture file. Here we use openspace.absPath so that we can use
-- the ${DATA} token to get the path to a texture in the "OpenSpace/data" folder,
-- but for a file at a relative location it would also work to use asset.resource,
-- like for the data file above
File = openspace.absPath("${DATA}/test3.jpg"),
},
-- Disable additive blending, so that points will be rendered with their actual color
-- and overlapping points will be sorted by depth. This works best when the points
-- have an opacity of 1
UseAdditiveBlending = false
},
GUI = {
Name = "Textured",
Path = "/Examples/RenderablePointCloud"
}
}
asset.onInitialize(function()
openspace.addSceneGraphNode(Node)
end)
asset.onDeinitialize(function()
openspace.removeSceneGraphNode(Node)
end)
@@ -0,0 +1,24 @@
-- Units
-- This example creates a point cloud where the positions are interpreted to be in
-- another unit than meters (here kilometers).
local Node = {
Identifier = "RenderablePointCloud_Example_Units",
Renderable = {
Type = "RenderablePointCloud",
File = asset.resource("data/dummydata.csv"),
Unit = "Km"
},
GUI = {
Name = "Units",
Path = "/Examples/RenderablePointCloud"
}
}
asset.onInitialize(function()
openspace.addSceneGraphNode(Node)
end)
asset.onDeinitialize(function()
openspace.removeSceneGraphNode(Node)
end)