mirror of
https://github.com/OpenSpace/OpenSpace.git
synced 2026-01-06 03:29:44 -06:00
Move the primitives example asset into the existing structure
This commit is contained in:
@@ -1,70 +0,0 @@
|
||||
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"
|
||||
}
|
||||
@@ -1,16 +1,16 @@
|
||||
-- Ring
|
||||
-- The `RenderableRadialGrid` can also be used to create a simple ring. This is done by
|
||||
-- Circle
|
||||
-- The `RenderableRadialGrid` can also be used to create a simple circle. This is done by
|
||||
-- setting the number of segments in each direction to 1 and make sure the inner radius
|
||||
-- is zero (which is the default).
|
||||
|
||||
local Node = {
|
||||
Identifier = "RenderableRadialGrid_Example_Ring",
|
||||
Identifier = "RenderableRadialGrid_Example_Circle",
|
||||
Renderable = {
|
||||
Type = "RenderableRadialGrid",
|
||||
GridSegments = { 1, 1 }
|
||||
},
|
||||
GUI = {
|
||||
Name = "RenderableRadialGrid - Ring",
|
||||
Name = "RenderableRadialGrid - Circle",
|
||||
Path = "/Examples"
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,32 @@
|
||||
-- Ellipse
|
||||
-- The `RenderableRadialGrid` can also be used to create a simple ellipse. This is done by
|
||||
-- setting the number of segments in each direction to 1 and make sure the inner radius
|
||||
-- is zero (which is the default). By then applying a
|
||||
-- [NonUniformStaticScale](#base_transform_scale_nonuniformstatic) to the scene graph node
|
||||
-- this circle can be deformed into an ellipse.
|
||||
|
||||
local Node = {
|
||||
Identifier = "RenderableRadialGrid_Example_Ellipse",
|
||||
Transform = {
|
||||
Scale = {
|
||||
Type = "NonUniformStaticScale",
|
||||
Scale = { 1.5, 1.0, 1.0 }
|
||||
}
|
||||
},
|
||||
Renderable = {
|
||||
Type = "RenderableRadialGrid",
|
||||
GridSegments = { 1, 1 }
|
||||
},
|
||||
GUI = {
|
||||
Name = "RenderableRadialGrid - Ellipse",
|
||||
Path = "/Examples"
|
||||
}
|
||||
}
|
||||
|
||||
asset.onInitialize(function()
|
||||
openspace.addSceneGraphNode(Node)
|
||||
end)
|
||||
|
||||
asset.onDeinitialize(function()
|
||||
openspace.removeSceneGraphNode(Node)
|
||||
end)
|
||||
Reference in New Issue
Block a user