Files
OpenSpace/data/assets/examples/grids.asset
T
Emma Broman 4d5ce33903 Add UI descriptions and asset metas to a bunch of assets (#2845)
* Add asset meta and GUI description to AltAz grid and move to Night sky in menu

To avoid confusion with other grids, that have a global position rather than a local one

* Add asset metas and GUI descriptions to Night Sky assets

* Add metas and update name of some example assets

* Night sky asset meta

* Add descriptions and asset metas to scale objects

---------

Co-authored-by: Ylva Selling <ylva.selling@gmail.com>
2023-08-18 16:33:59 +02:00

124 lines
2.6 KiB
Lua

local AU = 149597870700 -- 1 AU
local RadialGrid = {
Identifier = "ExampleRadialGrid",
Parent = "Root",
Transform = {
Scale = {
Type = "StaticScale",
Scale = AU
}
},
Renderable = {
Type = "RenderableRadialGrid",
Opacity = 0.8,
Color = { 0.6, 1.0, 0.7 },
LineWidth = 3.0,
GridSegments = { 3, 4 },
Radii = { 0.2, 1.0 }
},
GUI = {
Name = "Example Radial Grid",
Description = [[A circular 2D grid, with segments based on the radius and angle.]],
Path = "/Examples/Grids"
}
}
local PlanarGrid = {
Identifier = "ExampleGrid",
Transform = {
Scale = {
Type = "StaticScale",
Scale = AU
}
},
Renderable = {
Type = "RenderableGrid",
Color = { 0.0, 1.0, 0.8 },
LineWidth = 2.0,
Segments = { 6, 10 },
Size = { 1, 2 },
HighlightColor = { 1.0, 0.8, 0.0 },
HighlightLineWidth = 3.2,
HighlightRate = { 3, 3 }
},
GUI = {
Name = "Example Grid",
Description = [[A basic 2D grid, with a given size and number of segments.]],
Path = "/Examples/Grids"
}
}
local SphericalGrid = {
Identifier = "ExampleSphericalGrid",
Transform = {
Scale = {
Type = "StaticScale",
Scale = AU
}
},
Renderable = {
Type = "RenderableSphericalGrid",
Color = { 1.0, 0.5, 0.2 },
LineWidth = 2.0,
Segments = 40
},
GUI = {
Name = "Example Spherical Grid",
Description = [[A grid in the form of a 3D sphere.]],
Path = "/Examples/Grids"
}
}
local BoxGrid = {
Identifier = "ExampleBoxGrid",
Transform = {
Scale = {
Type = "StaticScale",
Scale = AU
}
},
Renderable = {
Type = "RenderableBoxGrid",
Color = { 0.5, 0.0, 1.0 },
LineWidth = 2.0,
Size = { 2, 2, 2 },
Enabled = false
},
GUI = {
Name = "Example Box Grid",
Description = [[A grid in the form of a 3D box.]],
Path = "/Examples/Grids"
}
}
asset.onInitialize(function()
openspace.addSceneGraphNode(RadialGrid)
openspace.addSceneGraphNode(PlanarGrid)
openspace.addSceneGraphNode(SphericalGrid)
openspace.addSceneGraphNode(BoxGrid)
end)
asset.onDeinitialize(function()
openspace.removeSceneGraphNode(BoxGrid)
openspace.removeSceneGraphNode(SphericalGrid)
openspace.removeSceneGraphNode(PlanarGrid)
openspace.removeSceneGraphNode(RadialGrid)
end)
asset.export(RadialGrid)
asset.export(PlanarGrid)
asset.export(SphericalGrid)
asset.export(BoxGrid)
asset.meta = {
Name = "Example Grids",
Version = "1.0",
Description = [[Examples of different types of rendered grids.]],
Author = "OpenSpace Team",
URL = "http://openspaceproject.com",
License = "MIT license"
}