Files
OpenSpace/data/assets/examples/primitives.asset
2024-06-19 11:26:07 +02:00

70 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",
Description = [[Examples of different simple rendered primitives, such as circles
and ellipses.]],
Author = "OpenSpace Team",
URL = "http://openspaceproject.com",
License = "MIT license"
}