RenderableDisc

Inherits Renderable

Members

Name

Documentation

Type

Description

Optional

Texture

The path to a file with a one-dimensional texture to be used for the disc color. The leftmost color will be innermost color when rendering the disc, and the rightmost color will be the outermost color.

File

Value of type ‘File’

No

Size

The outer radius of the disc, in meters.

Double

Value of type ‘Double’

Yes

Width

The disc width, given as a ratio of the full disc radius. For example, a value of 1 results in a full circle, while 0.5 results in a disc where the inner radius is half of the full radius.

Double

In range: ( 0,1 )

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, PostDeferredTransparent, Overlay }

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

 1-- @TODO (emmbr 2020-02-03) Potential threading issue later on? This will run on the main thread
 2local cyanTexture = openspace.createSingleColorImage("example_disc_color1", { 0.0, 1.0, 1.0 })
 3local purpleTexture = openspace.createSingleColorImage("example_disc_color2", { 0.5, 0.0, 0.5 })
 4
 5local BasicDisc = {
 6  Identifier = "BasicDisc",
 7  Renderable = {
 8    Type = "RenderableDisc",
 9    Texture = cyanTexture,
10    Size = 1e10,
11    Width = 0.5
12  },
13  GUI = {
14    Name = "Basic Disc",
15    Path = "/Examples/Discs"
16  }
17}
18
19-- Elliptic discs can be created using a non-uniform scaling
20-- For a full disc, use a width of 1.0
21local FullEllipticDisc = {
22  Identifier = "FullEllipticDisc",
23  Transform = {
24    Scale = {
25      Type = "NonUniformStaticScale",
26      Scale = { 2.0, 1.0, 1.0 }
27    }
28  },
29  Renderable = {
30    Type = "RenderableDisc",
31    Texture = purpleTexture,
32    Size = 2e10,
33    Width = 1.0
34  },
35  GUI = {
36    Name = "Full Elliptic Disc",
37    Path = "/Examples/Discs"
38  }
39}
40
41
42asset.onInitialize(function()
43  openspace.addSceneGraphNode(BasicDisc)
44  openspace.addSceneGraphNode(FullEllipticDisc)
45end)
46
47asset.onDeinitialize(function()
48  openspace.removeSceneGraphNode(FullEllipticDisc)
49  openspace.removeSceneGraphNode(BasicDisc)
50end)
51
52asset.export(BasicDisc)
53asset.export(FullEllipticDisc)
54
55
56
57asset.meta = {
58  Name = "Example Discs",
59  Description = [[Examples of different types of rendered discs.]],
60  Author = "OpenSpace Team",
61  URL = "http://openspaceproject.com",
62  License = "MIT license"
63}