From c7f2ab1a438dcc554c9d73fc07b3fcf835c89869 Mon Sep 17 00:00:00 2001 From: Alexander Bock Date: Wed, 14 Aug 2024 15:10:44 +0200 Subject: [PATCH] Define the supergalactic transformation matrix only once and reuse in other assets --- data/assets/scene/digitaluniverse/abell.asset | 15 ++++++--------- .../digitaluniverse/galaxy_clusters.asset | 15 ++++++--------- .../scene/digitaluniverse/galaxy_groups.asset | 15 ++++++--------- .../digitaluniverse/milkyway_label.asset | 13 +++++-------- .../scene/digitaluniverse/transforms.asset | 19 +++++++++++++++++++ data/assets/scene/digitaluniverse/tully.asset | 17 +++++++---------- 6 files changed, 49 insertions(+), 45 deletions(-) create mode 100644 data/assets/scene/digitaluniverse/transforms.asset diff --git a/data/assets/scene/digitaluniverse/abell.asset b/data/assets/scene/digitaluniverse/abell.asset index dce457d151..a7282aaac8 100644 --- a/data/assets/scene/digitaluniverse/abell.asset +++ b/data/assets/scene/digitaluniverse/abell.asset @@ -1,3 +1,7 @@ +local transforms = asset.require("./transforms") + + + local textures = asset.resource({ Name = "Point Textures", Type = "HttpSynchronization", @@ -13,13 +17,6 @@ local speck = asset.resource({ }) -local TransformMatrix = { - -0.7357425748, 0.67726129641, 0.0, 0.0, - -0.074553778365, -0.080991471307, 0.9939225904, 0.0, - 0.67314530211, 0.73127116582, 0.11008126223, 0.0, - 0.0, 0.0, 0.0, 1.0 -} - local Object = { Identifier = "Abell", Renderable = { @@ -33,7 +30,7 @@ local Object = { Size = 21.2, MinMaxSize = { 10, 12 }, Unit = "Mpc", - TransformationMatrix = TransformMatrix + TransformationMatrix = transforms.Supergalactic }, Opacity = 1.0, Coloring = { @@ -44,7 +41,7 @@ local Object = { File = textures .. "point3A.png", }, Unit = "Mpc", - TransformationMatrix = TransformMatrix, + TransformationMatrix = transforms.Supergalactic, SizeSettings = { ScaleExponent = 23.2, MaxSize = 0.27, diff --git a/data/assets/scene/digitaluniverse/galaxy_clusters.asset b/data/assets/scene/digitaluniverse/galaxy_clusters.asset index 82ca6b29c9..bd7fda1509 100644 --- a/data/assets/scene/digitaluniverse/galaxy_clusters.asset +++ b/data/assets/scene/digitaluniverse/galaxy_clusters.asset @@ -1,3 +1,7 @@ +local transforms = asset.require("./transforms") + + + local speck = asset.resource({ Name = "Clusters Speck Files", Type = "HttpSynchronization", @@ -6,13 +10,6 @@ local speck = asset.resource({ }) -local TransformMatrix = { - -0.7357425748, 0.67726129641, 0.0, 0.0, - -0.074553778365, -0.080991471307, 0.9939225904, 0.0, - 0.67314530211, 0.73127116582, 0.11008126223, 0.0, - 0.0, 0.0, 0.0, 1.0 -} - local Object = { Identifier = "GalaxyClusterLabels", Renderable = { @@ -25,11 +22,11 @@ local Object = { Size = 22, MinMaxSize = { 8, 15 }, Unit = "Mpc", - TransformationMatrix = TransformMatrix + TransformationMatrix = transforms.Supergalactic }, Opacity = 0.65, Unit = "Mpc", - TransformationMatrix = TransformMatrix + TransformationMatrix = transforms.Supergalactic }, GUI = { Name = "Galaxy Cluster Labels", diff --git a/data/assets/scene/digitaluniverse/galaxy_groups.asset b/data/assets/scene/digitaluniverse/galaxy_groups.asset index e56532083a..e051227eee 100644 --- a/data/assets/scene/digitaluniverse/galaxy_groups.asset +++ b/data/assets/scene/digitaluniverse/galaxy_groups.asset @@ -1,3 +1,7 @@ +local transforms = asset.require("./transforms") + + + local speck = asset.resource({ Name = "Galaxy Groups Speck Files", Type = "HttpSynchronization", @@ -6,13 +10,6 @@ local speck = asset.resource({ }) -local TransformMatrix = { - -0.7357425748, 0.67726129641, 0.0, 0.0, - -0.074553778365, -0.080991471307, 0.9939225904, 0.0, - 0.67314530211, 0.73127116582, 0.11008126223, 0.0, - 0.0, 0.0, 0.0, 1.0 -} - local Object = { Identifier = "NearbyGalaxyGroups", Renderable = { @@ -25,11 +22,11 @@ local Object = { Size = 20.4, MinMaxSize = { 8, 20 }, Unit = "Mpc", - TransformationMatrix = TransformMatrix + TransformationMatrix = transforms.Supergalactic }, Opacity = 0.65, Unit = "Mpc", - TransformationMatrix = TransformMatrix + TransformationMatrix = transforms.Supergalactic }, GUI = { Name = "Galaxy Group Labels", diff --git a/data/assets/scene/digitaluniverse/milkyway_label.asset b/data/assets/scene/digitaluniverse/milkyway_label.asset index 41a7752969..5393556afc 100644 --- a/data/assets/scene/digitaluniverse/milkyway_label.asset +++ b/data/assets/scene/digitaluniverse/milkyway_label.asset @@ -1,3 +1,7 @@ +local transforms = asset.require("./transforms") + + + local homespeck = asset.resource({ Name = "Home Speck File", Type = "HttpSynchronization", @@ -5,13 +9,6 @@ local homespeck = asset.resource({ Version = 1 }) -local TransformMatrix = { - -0.7357425748, 0.67726129641, 0.0, 0.0, - -0.074553778365, -0.080991471307, 0.9939225904, 0.0, - 0.67314530211, 0.73127116582, 0.11008126223, 0.0, - 0.0, 0.0, 0.0, 1.0 -} - local Object = { Identifier = "HomeLabel", @@ -25,7 +22,7 @@ local Object = { Size = 20.50, MinMaxSize = { 16, 20 }, Unit = "Mpc", - TransformationMatrix = TransformMatrix + TransformationMatrix = transforms.Supergalactic } }, GUI = { diff --git a/data/assets/scene/digitaluniverse/transforms.asset b/data/assets/scene/digitaluniverse/transforms.asset new file mode 100644 index 0000000000..7276eb0083 --- /dev/null +++ b/data/assets/scene/digitaluniverse/transforms.asset @@ -0,0 +1,19 @@ +local Supergalactic = { + -0.7357425748, 0.67726129641, 0.0, 0.0, + -0.074553778365, -0.080991471307, 0.9939225904, 0.0, + 0.67314530211, 0.73127116582, 0.11008126223, 0.0, + 0.0, 0.0, 0.0, 1.0 +} + +asset.export("Supergalactic", Supergalactic) + + + +asset.meta = { + Name = "Supergalactic Transformation", + Description = [[This asset defines the transformation matrix to convert supergalactic + coordinates into galactic coordinates.]], + Author = "OpenSpace Team", + URL = "https://openspaceproject.com", + License = "MIT license" +} diff --git a/data/assets/scene/digitaluniverse/tully.asset b/data/assets/scene/digitaluniverse/tully.asset index 44d72b1a50..ba74452a65 100644 --- a/data/assets/scene/digitaluniverse/tully.asset +++ b/data/assets/scene/digitaluniverse/tully.asset @@ -1,3 +1,7 @@ +local transforms = asset.require("./transforms") + + + local textures = asset.resource({ Name = "Tully Textures", Type = "HttpSynchronization", @@ -13,13 +17,6 @@ local speck = asset.resource({ }) -local TransformMatrix = { - -0.7357425748, 0.67726129641, 0.0, 0.0, - -0.074553778365, -0.080991471307, 0.9939225904, 0.0, - 0.67314530211, 0.73127116582, 0.11008126223, 0.0, - 0.0, 0.0, 0.0, 1.0 -} - local TullyGalaxies = { Identifier = "TullyGalaxies", Renderable = { @@ -31,7 +28,7 @@ local TullyGalaxies = { Size = 19.36, MinMaxSize = { 8, 20 }, Unit = "Mpc", - TransformationMatrix = TransformMatrix + TransformationMatrix = transforms.Supergalactic }, Opacity = 0.99, File = speck .. "tully.speck", @@ -49,7 +46,7 @@ local TullyGalaxies = { } }, Unit = "Mpc", - TransformationMatrix = TransformMatrix, + TransformationMatrix = transforms.Supergalactic, Fading = { FadeInDistances = { 0.001, 1.0 } -- Fade in value in the same unit as "Unit" }, @@ -86,7 +83,7 @@ local TullyGalaxiesImages = { Texture = { Folder = textures }, - TransformationMatrix = TransformMatrix, + TransformationMatrix = transforms.Supergalactic, -- Use fixed orientation, and rotate planes based on orientation information in -- the dataset OrientationRenderOption = "Fixed Rotation",