RenderableSphericalGrid

Inherits Renderable

This Renderable creates a grid in the shape of a sphere. Note that the sphere will always be given a radius of one meter. To change its size, use a Scale transform, such as the StaticScale.

The grid may be split up into equal segments in both directions using the Segments parameter, or different number of segments in the latitudal and longtudal direction using the LatSegments and LongSegments parameters.

Members

Name

Documentation

Type

Description

Optional

Color

The color of the grid lines.

Color3

Value of type ‘Color3’

Yes

Labels

The labels for the grid.

Table

LabelsComponent

Yes

LatSegments

The number of latitudinal segments the sphere is split into. Determines the resolution of the rendered sphere in a up/down direction when looking straight at the equator. Should be an even value (if an odd value is provided, the value will be set to the new value minus one). If the Segments value is provided as well, it will have precedence over this value

Integer

Value of type ‘Integer’

Yes

LineWidth

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

Double

Value of type ‘Double’

Yes

LongSegments

The number of longitudinal segments the sphere is split into. Determines the resolution of the rendered sphere in a left/right direction when looking straight at the equator. Should be an even value (if an odd value is provided, the value will be set to the new value minus one). If the Segments value is provided as well, it will have precedence over this value

Integer

Value of type ‘Integer’

Yes

Segments

The number of segments the sphere is split into. Determines the resolution of the rendered sphere. Should be an even value (if an odd value is provided, the value will be set to the new value minus one). Setting this value is equal to setting LongSegments and LatSegments to the same value. If this value is specified, it will overwrite the values provided in LongSegments and LatSegments.

Integer

Value of type ‘Integer’

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

Basic

This example adds a spherical grid with a radius of 100 meters.

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

This example adds a spherical grid with a radius of 100 meters, where the sphere is split up into 100 segments in each direction. The default is 64.

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

This example adds a spherical grid with a custom color and line width.

 1local Node = {
 2  Identifier = "RenderableSphericalGrid_Example_Styled",
 3  Renderable = {
 4    Type = "RenderableSphericalGrid",
 5    Color = { 0.0, 0.0, 1.0 },
 6    LineWidth = 2.0
 7  },
 8  GUI = {
 9    Name = "RenderableSphericalGrid - Styled",
10    Path = "/Examples"
11  }
12}
13
14asset.onInitialize(function()
15  openspace.addSceneGraphNode(Node)
16end)
17
18asset.onDeinitialize(function()
19  openspace.removeSceneGraphNode(Node)
20end)
Different Number of Segments in Latitudinal and Longitudinal Direction

This example adds a spherical grid with a radius of 100 meters, where the sphere is split up into 100 segments in the longitudinal direction and 10 segments in the latitudinal direction.

 1local Node = {
 2  Identifier = "RenderableSphericalGrid_Example_SegmentsLatLong",
 3  Transform = {
 4    Scale = {
 5      Type = "StaticScale",
 6      Scale = 100.0
 7    }
 8  },
 9  Renderable = {
10    Type = "RenderableSphericalGrid",
11    LatSegments = 100,
12    LongSegments = 10
13  },
14  GUI = {
15    Name = "RenderableSphericalGrid - Segments Lat/Long",
16    Path = "/Examples"
17  }
18}
19
20asset.onInitialize(function()
21  openspace.addSceneGraphNode(Node)
22end)
23
24asset.onDeinitialize(function()
25  openspace.removeSceneGraphNode(Node)
26end)