RenderableRadialGrid

Inherits Renderable

This Renderable creates a planar circular grid with a given size. Optionally, it may have a hole in the center.

The size is determined by two radii values: The first (inner) radius defines the hole in the center. The second (outer) radius defines the full grid size. To create a solid circle that connects at the center, set the inner radius to zero (default).

Members

Name

Documentation

Type

Description

Optional

CircleSegments

The number of segments that is used to render each circle in the grid.

Integer

Value of type ‘Integer’

Yes

Color

The color used for the grid lines.

Color3

Value of type ‘Color3’

Yes

GridSegments

Specifies the number of segments for the grid, in the radial and angular direction respectively.

Vector2<int>

Value of type ‘Vector2

Yes

Labels

The labels for the grid.

Table

LabelsComponent

Yes

LineWidth

The width of the grid lines. The larger number, the thicker the lines.

Double

Value of type ‘Double’

Yes

Radii

The radii values that determine the size of the circular grid. The first value is the radius of the inmost ring and the second is the radius of the outmost ring.

Vector2<double>

Value of type ‘Vector2

Yes

Inherited members from Renderable

Name

Documentation

Type

Description

Optional

DimInAtmosphere

Decides if the object should be dimmed (i.e. faded out) when the camera is in the sunny part of an atmosphere.

Boolean

Value of type ‘Boolean’

Yes

Enabled

Determines whether this object will be visible or not.

Boolean

Value of type ‘Boolean’

Yes

Opacity

This value determines the opacity of this renderable. A value of 0 means completely transparent.

Double

In range: ( 0,1 )

Yes

RenderBinMode

A value that specifies if the renderable should be rendered in the Background, Opaque, Pre-/PostDeferredTransparency, Overlay, or Sticker rendering step.

String

In list { Background, Opaque, PreDeferredTransparent, Overlay, PostDeferredTransparent, Sticker }

Yes

Tag

A single tag or a list of tags that this renderable will respond to when setting properties.

Table, or String

Value of type ‘Table’, or Value of type ‘String’

Yes

Type

The type of the renderable.

String

Value of type ‘String’

Yes

Asset Examples

Styled

This example adds a circular grid with a specific color and line width. Note that we keep the size at its default value.

 1local Node = {
 2  Identifier = "RenderableRadialGrid_Example_Styled",
 3  Renderable = {
 4    Type = "RenderableRadialGrid",
 5    Color = { 1.0, 0.0, 0.0 },
 6    LineWidth = 2.0
 7  },
 8  GUI = {
 9    Name = "RenderableRadialGrid - Styled",
10    Path = "/Examples"
11  }
12}
13
14asset.onInitialize(function()
15  openspace.addSceneGraphNode(Node)
16end)
17
18asset.onDeinitialize(function()
19  openspace.removeSceneGraphNode(Node)
20end)
Ring

The RenderableRadialGrid can also be used to create a simple ring. 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).

 1local Node = {
 2  Identifier = "RenderableRadialGrid_Example_Ring",
 3  Renderable = {
 4    Type = "RenderableRadialGrid",
 5    GridSegments = { 1, 1 }
 6  },
 7  GUI = {
 8    Name = "RenderableRadialGrid - Ring",
 9    Path = "/Examples"
10  }
11}
12
13asset.onInitialize(function()
14  openspace.addSceneGraphNode(Node)
15end)
16
17asset.onDeinitialize(function()
18  openspace.removeSceneGraphNode(Node)
19end)
Basic

This example adds a circular grid with a radius of 100 meters to the scene. Per default, the grid is split into 10 angular and radial segments.

The grid is created with a radius of 1 meter per default. Here we scale it up by a factor of 100 to get the desired size.

 1local Node = {
 2  Identifier = "RenderableRadialGrid_Example",
 3  Transform = {
 4    Scale = {
 5      Type = "StaticScale",
 6      Scale = 100.0
 7    }
 8  },
 9  Renderable = {
10    Type = "RenderableRadialGrid"
11  },
12  GUI = {
13    Name = "RenderableRadialGrid - Basic",
14    Path = "/Examples"
15  }
16}
17
18asset.onInitialize(function()
19  openspace.addSceneGraphNode(Node)
20end)
21
22asset.onDeinitialize(function()
23  openspace.removeSceneGraphNode(Node)
24end)
Custom Radii

This example adds a circular grid with a radius of 100 meters with a hole of 10 meters in the center. This is achieved by specifying two radii, the first one being the radius of the inner circle and the second one being the radius of the outer circle.

 1local Node = {
 2  Identifier = "RenderableRadialGrid_Example_Radii",
 3  Renderable = {
 4    Type = "RenderableRadialGrid",
 5    Radii = { 10.0, 100.0 }
 6  },
 7  GUI = {
 8    Name = "RenderableRadialGrid - Custom Radii",
 9    Path = "/Examples"
10  }
11}
12
13asset.onInitialize(function()
14  openspace.addSceneGraphNode(Node)
15end)
16
17asset.onDeinitialize(function()
18  openspace.removeSceneGraphNode(Node)
19end)
Custom Grid Segments

This example adds a circular grid with 10 segments in the radial direction and 1 segment in the angular direction. 1 here means that we do not split the grid into smaller segments in the angular direction.

 1local Node = {
 2  Identifier = "RenderableRadialGrid_Example_Segments",
 3  Renderable = {
 4    Type = "RenderableRadialGrid",
 5    GridSegments = { 10, 1 }
 6  },
 7  GUI = {
 8    Name = "RenderableRadialGrid - Segments",
 9    Path = "/Examples"
10  }
11}
12
13asset.onInitialize(function()
14  openspace.addSceneGraphNode(Node)
15end)
16
17asset.onDeinitialize(function()
18  openspace.removeSceneGraphNode(Node)
19end)