mirror of
https://github.com/OpenSpace/OpenSpace.git
synced 2026-01-05 11:09:37 -06:00
Docs and examples for RenderableBoxGrid (#3479)
* Add boxgrid examples * Add description about the box grid renderable for the docs page * change phrasing in example assets slightly * Apply suggestions from code review Co-authored-by: Ylva Selling <ylva.selling@gmail.com> * Remove labels support for `RenderableBoxGrid` --------- Co-authored-by: Ylva Selling <ylva.selling@gmail.com>
This commit is contained in:
@@ -0,0 +1,31 @@
|
||||
-- Basic
|
||||
-- This example adds a box grid, which is a 3D box rendered using grid lines, to the
|
||||
-- scene.
|
||||
--
|
||||
-- Per default, the box will be given a size of 1x1x1 meters, and here it is scaled up by a
|
||||
-- factor of 100. It will hence have a size of 100x100x100 meters.
|
||||
|
||||
local Node = {
|
||||
Identifier = "RenderableBoxGrid_Example",
|
||||
Transform = {
|
||||
Scale = {
|
||||
Type = "StaticScale",
|
||||
Scale = 100
|
||||
}
|
||||
},
|
||||
Renderable = {
|
||||
Type = "RenderableBoxGrid"
|
||||
},
|
||||
GUI = {
|
||||
Name = "RenderableBoxGrid - Basic",
|
||||
Path = "/Examples"
|
||||
}
|
||||
}
|
||||
|
||||
asset.onInitialize(function()
|
||||
openspace.addSceneGraphNode(Node)
|
||||
end)
|
||||
|
||||
asset.onDeinitialize(function()
|
||||
openspace.removeSceneGraphNode(Node)
|
||||
end)
|
||||
@@ -0,0 +1,32 @@
|
||||
-- With Non-uniform Size
|
||||
-- This example creates a box grid with a non-uniform size. The size has been set so the
|
||||
-- box is two times larger in the Y-direction.
|
||||
--
|
||||
-- The `Size` values are given in meters, and here the box is scaled up by a factor of
|
||||
-- 100. So, the box will have a size of 100 times the `Size` values.
|
||||
|
||||
local Node = {
|
||||
Identifier = "RenderableBoxGrid_Example_Size",
|
||||
Transform = {
|
||||
Scale = {
|
||||
Type = "StaticScale",
|
||||
Scale = 100
|
||||
}
|
||||
},
|
||||
Renderable = {
|
||||
Type = "RenderableBoxGrid",
|
||||
Size = { 1.0, 2.0, 1.0 }
|
||||
},
|
||||
GUI = {
|
||||
Name = "RenderableBoxGrid - Non-uniform Size",
|
||||
Path = "/Examples"
|
||||
}
|
||||
}
|
||||
|
||||
asset.onInitialize(function()
|
||||
openspace.addSceneGraphNode(Node)
|
||||
end)
|
||||
|
||||
asset.onDeinitialize(function()
|
||||
openspace.removeSceneGraphNode(Node)
|
||||
end)
|
||||
@@ -0,0 +1,24 @@
|
||||
-- Styled
|
||||
-- This example creates a box grid where the grid lines are styled to have a specific
|
||||
-- color and line width.
|
||||
|
||||
local Node = {
|
||||
Identifier = "RenderableBoxGrid_Example_Styled",
|
||||
Renderable = {
|
||||
Type = "RenderableBoxGrid",
|
||||
LineWidth = 4.0,
|
||||
Color = { 1.0, 1.0, 0.0 }
|
||||
},
|
||||
GUI = {
|
||||
Name = "RenderableBoxGrid - Styled",
|
||||
Path = "/Examples"
|
||||
}
|
||||
}
|
||||
|
||||
asset.onInitialize(function()
|
||||
openspace.addSceneGraphNode(Node)
|
||||
end)
|
||||
|
||||
asset.onDeinitialize(function()
|
||||
openspace.removeSceneGraphNode(Node)
|
||||
end)
|
||||
Reference in New Issue
Block a user