RenderableConstellationLines

Inherits Renderable

This renderable can be used to draw constellations using lines. Each constellation corresponds to a group of lines between 3D positions that represent the star positions.

Each constellation is given an abbreviation that acts as the identifier of the constellation. These abbreviations can be mapped to full names in the optional NamesFile. The names in this file are then the ones that will show in the user interface. A line in the NamesFile should first include the abbreviation and then the full name. For example: AND Andromeda.

If labels were added, the full names in the NamesFile may also be used for the text of the labels. Note that labels are added using a different file, where each line may or may not include an identifier for that specific label, marked by id in the file. If a row in the label file has an id that matches the abbreviation of the constellation, the text of that label is replaced with the full name from the NamesFile.

Members

Name

Documentation

Type

Description

Optional

File

The path to a SPECK file that contains the data for the constellation lines.

File

Value of type ‘File’

No

Colors

A list of colors to use for the constellations. A data file may include several groups of constellations, where each group can have a distinct color. The index for the color parameter for each constellation in the data file corresponds to the order of the colors in this list.

Table

Table parameters

Yes

DrawElements

Enables/Disables the drawing of the constellations.

Boolean

Value of type ‘Boolean’

Yes

Labels

The labels for the constellations.

Table

LabelsComponent

Yes

LineWidth

The line width used for the constellation shape.

Double

Value of type ‘Double’

Yes

NamesFile

Specifies the file that contains the mapping between constellation abbreviations and full names of the constellations. If this value is empty, the abbreviations are used as the full names.

File

Value of type ‘File’

Yes

Selection

A list of constellations (given as abbreviations) to show. If empty or excluded, all constellations will be shown.

Table

Table parameters

Yes

Unit

The distance unit used for the constellation lines data.

String

In list { m, Km, pc, Kpc, Mpc, Gpc, Gly }

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

Table parameters for Colors

A list of colors to use for the constellations. A data file may include several groups of constellations, where each group can have a distinct color. The index for the color parameter for each constellation in the data file corresponds to the order of the colors in this list.

  • Optional: Yes

Name

Documentation

Type

Description

Optional

*

Vector3<double>

Value of type ‘Vector3

Yes

Table parameters for Selection

A list of constellations (given as abbreviations) to show. If empty or excluded, all constellations will be shown.

  • Optional: Yes

Name

Documentation

Type

Description

Optional

*

String

Value of type ‘String’

Yes

Asset Examples

 1local speck = asset.resource({
 2  Name = "Big Dipper Constellation Files",
 3  Type = "HttpSynchronization",
 4  Identifier = "digitaluniverse_constellations_bigdipper",
 5  Version = 1
 6})
 7
 8
 9local BigDipper = {
10  Identifier = "BigDipperConstellation",
11  Renderable = {
12    Type = "RenderableConstellationLines",
13    Enabled = false,
14    Labels = {
15      File = speck .. "bigdipper.label",
16      Opacity = 0.3,
17      Color = { 0.8, 0.8, 0.8 },
18      Size = 14.5,
19      MinMaxSize = { 8, 170 },
20      Unit = "pc"
21    },
22    Opacity = 0.3,
23    File = speck .. "bigdipper.speck",
24    NamesFile = speck .. "bigdipper.dat",
25    Colors = { { 0.6, 0.4, 0.4 }, { 0.8, 0.0, 0.0 }, { 0.0, 0.3, 0.8 } },
26    Unit = "pc",
27    DimInAtmosphere = true
28  },
29  Tag = { "daytime_hidden" },
30  GUI = {
31    Name = "Big Dipper",
32    Path = "/Milky Way/Constellations",
33    Description = [[This item only draws the big dipper, and not the rest of the
34      lines of the Ursa Major constellation.]]
35  }
36}
37
38
39asset.onInitialize(function()
40  openspace.addSceneGraphNode(BigDipper)
41end)
42
43asset.onDeinitialize(function()
44  openspace.removeSceneGraphNode(BigDipper)
45end)
46
47asset.export(BigDipper)
48
49
50
51asset.meta = {
52  Name = "Big Dipper",
53  Description = "Constellation lines for the Big Dipper",
54  Author = "OpenSpace Team",
55  URL = "https://www.openspaceproject.com",
56  License = "MIT"
57}