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 |
---|---|---|---|---|
|
The path to a SPECK file that contains the data for the constellation lines. |
|
Value of type ‘File’ |
No |
|
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. |
|
Yes |
|
|
Enables/Disables the drawing of the constellations. |
|
Value of type ‘Boolean’ |
Yes |
|
The labels for the constellations. |
|
Yes |
|
|
The line width used for the constellation shape. |
|
Value of type ‘Double’ |
Yes |
|
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. |
|
Value of type ‘File’ |
Yes |
|
A list of constellations (given as abbreviations) to show. If empty or excluded, all constellations will be shown. |
|
Yes |
|
|
The distance unit used for the constellation lines data. |
|
In list { m, Km, pc, Kpc, Mpc, Gpc, Gly } |
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 |
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 |
---|---|---|---|---|
|
|
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 |
---|---|---|---|---|
|
|
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}