mirror of
https://github.com/OpenSpace/OpenSpace.git
synced 2026-04-23 04:30:09 -05:00
59 lines
1.1 KiB
Lua
59 lines
1.1 KiB
Lua
local scale = 149597870700 -- 1 AU
|
|
|
|
local circle = {
|
|
Identifier = "ExampleCircle",
|
|
Transform = {
|
|
Scale = {
|
|
Type = "StaticScale",
|
|
Scale = scale
|
|
}
|
|
},
|
|
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, scale }
|
|
},
|
|
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)
|