RenderableBoxGrid
Inherits Renderable
A RenderableBoxGrid creates a 3D box that is rendered using grid lines.
Per default the box is given a uniform size of 1x1x1 meters. It can then be scaled to the desired size. Alternatively, the size in each dimension can be specified.
Members
Name |
Documentation |
Type |
Description |
Optional |
---|---|---|---|---|
|
The color used for the grid lines. |
|
Value of type ‘Color3’ |
Yes |
|
The width of the grid lines. The larger number, the thicker the lines. |
|
Value of type ‘Double’ |
Yes |
|
The size of each dimension of the box, in meters. |
|
Value of type ‘Vector3 |
Yes |
Inherited members from Renderable
Name |
Documentation |
Type |
Description |
Optional |
---|---|---|---|---|
|
Decides if the object should be dimmed (i.e. faded out) when the camera is in the sunny part of an atmosphere. |
|
Value of type ‘Boolean’ |
Yes |
|
Determines whether this object will be visible or not. |
|
Value of type ‘Boolean’ |
Yes |
|
This value determines the opacity of this renderable. A value of 0 means completely transparent. |
|
In range: ( 0,1 ) |
Yes |
|
A value that specifies if the renderable should be rendered in the Background, Opaque, Pre-/PostDeferredTransparency, Overlay, or Sticker rendering step. |
|
In list { Background, Opaque, PreDeferredTransparent, Overlay, PostDeferredTransparent, Sticker } |
Yes |
|
A single tag or a list of tags that this renderable will respond to when setting properties. |
|
Value of type ‘Table’, or Value of type ‘String’ |
Yes |
|
The type of the renderable. |
|
Value of type ‘String’ |
Yes |
Asset Examples
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.
1local Node = {
2 Identifier = "RenderableBoxGrid_Example",
3 Transform = {
4 Scale = {
5 Type = "StaticScale",
6 Scale = 100
7 }
8 },
9 Renderable = {
10 Type = "RenderableBoxGrid"
11 },
12 GUI = {
13 Name = "RenderableBoxGrid - Basic",
14 Path = "/Examples"
15 }
16}
17
18asset.onInitialize(function()
19 openspace.addSceneGraphNode(Node)
20end)
21
22asset.onDeinitialize(function()
23 openspace.removeSceneGraphNode(Node)
24end)
Styled
This example creates a box grid where the grid lines are styled to have a specific color and line width.
1local Node = {
2 Identifier = "RenderableBoxGrid_Example_Styled",
3 Renderable = {
4 Type = "RenderableBoxGrid",
5 LineWidth = 4.0,
6 Color = { 1.0, 1.0, 0.0 }
7 },
8 GUI = {
9 Name = "RenderableBoxGrid - Styled",
10 Path = "/Examples"
11 }
12}
13
14asset.onInitialize(function()
15 openspace.addSceneGraphNode(Node)
16end)
17
18asset.onDeinitialize(function()
19 openspace.removeSceneGraphNode(Node)
20end)
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.
1local Node = {
2 Identifier = "RenderableBoxGrid_Example_Size",
3 Transform = {
4 Scale = {
5 Type = "StaticScale",
6 Scale = 100
7 }
8 },
9 Renderable = {
10 Type = "RenderableBoxGrid",
11 Size = { 1.0, 2.0, 1.0 }
12 },
13 GUI = {
14 Name = "RenderableBoxGrid - Non-uniform Size",
15 Path = "/Examples"
16 }
17}
18
19asset.onInitialize(function()
20 openspace.addSceneGraphNode(Node)
21end)
22
23asset.onDeinitialize(function()
24 openspace.removeSceneGraphNode(Node)
25end)