Files
OpenSpace/data/assets/examples/primitives.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

71 lines
1.4 KiB
Lua

local AU = 149597870700 -- 1 AU
local Circle = {
Identifier = "ExampleCircle",
Transform = {
Scale = {
Type = "StaticScale",
Scale = AU
}
},
Renderable = {
Type = "RenderableRadialGrid",
Color = { 0.6, 0.6, 0.8 },
LineWidth = 3.0,
GridSegments = { 1, 1 },
CircleSegments = 64,
Radii = { 0.0, 1.0 }
},
GUI = {
Name = "Example Circle",
Path = "/Examples/Primitives"
}
}
local Ellipse = {
Identifier = "ExampleEllipse",
Transform = {
Scale = {
Type = "NonUniformStaticScale",
Scale = { 1.5, 1.0, 1.0 }
}
},
Renderable = {
Type = "RenderableRadialGrid",
Color = { 0.6, 0.8, 0.6 },
LineWidth = 3.0,
GridSegments = { 1, 1 },
CircleSegments = 64,
Radii = { 0.0, AU }
},
GUI = {
Name = "Example Ellipse",
Path = "/Examples/Primitives"
}
}
asset.onInitialize(function()
openspace.addSceneGraphNode(Circle)
openspace.addSceneGraphNode(Ellipse)
end)
asset.onDeinitialize(function()
openspace.removeSceneGraphNode(Ellipse)
openspace.removeSceneGraphNode(Circle)
end)
asset.export(Circle)
asset.export(Ellipse)
asset.meta = {
Name = "Primitives Example",
Version = "1.0",
Description = [[Examples of different simple rendered primitives, such as circles
and ellipses.]],
Author = "OpenSpace Team",
URL = "http://openspaceproject.com",
License = "MIT license"
}