RenderableSphereImageLocal

Inherits Renderable

Members

Name

Documentation

Type

Description

Optional

Segments

This value specifies the number of segments that the sphere is separated in

Integer

Value of type ‘Integer’

No

Size

This value specifies the radius of the sphere in meters

Double

Value of type ‘Double’

No

Texture

This value specifies an image that is loaded from disk and is used as a texture that is applied to this sphere. This image is expected to be an equirectangular projection

String

Value of type ‘String’

No

DisableFadeInOut

Enables/Disables the fade in and out effects

Boolean

Value of type ‘Boolean’

Yes

FadeInThreshold

This value determines the distance from center of MilkyWay from where the astronomical object starts to fade in, given as a percentage of the size of the object. A negative or zero value means no fading in will happen. This is also the default

Double

Value of type ‘Double’

Yes

FadeOutThreshold

This value determines percentage of the sphere that is visible before starting to fade it out. A negative or zero value means no fading out will happen. This is also the default

Double

In range: ( 0,1 )

Yes

LazyLoading

If this value is set to ‘true’, the image for this sphere will not be loaded at startup but rather when the image is shown for the first time. Additionally, if the sphere is disabled, the image will automatically be unloaded

Boolean

Value of type ‘Boolean’

Yes

MirrorTexture

Mirror the texture along the x-axis

Boolean

Value of type ‘Boolean’

Yes

Orientation

Specifies whether the texture is applied to the inside of the sphere, the outside of the sphere, or both

String

In list { Outside, Inside, Both }

Yes

Inherited members from Renderable

Name

Documentation

Type

Description

Optional

DimInAtmosphere

Enables/Disables if the object should be dimmed when the camera is in the sunny part of an atmosphere

Boolean

Value of type ‘Boolean’

Yes

Enabled

This setting 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

This value specifies if the renderable should be rendered in the Background,Opaque, Pre/PostDeferredTransparency, or Overlay 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

This tells the type of the renderable

String

Value of type ‘String’

Yes

Asset Examples

 1local spheres = {}
 2
 3local i = 1
 4for z = 1,3 do
 5  for y = 1,3 do
 6    for x = 1,3 do
 7      local Sphere = {
 8        Identifier = "ExampleSphere" .. i,
 9        Transform = {
10          Translation = {
11            Type = "StaticTranslation",
12            Position = { x, y, z }
13          }
14        },
15        Renderable = {
16          Type = "RenderableSphereImageLocal",
17          Size = 0.20 + i * 0.01,
18          Segments = 80,
19          Opacity = 1,
20          Texture = openspace.absPath("${DATA}/test2.jpg"),
21          Orientation = "Both",
22        },
23        GUI = {
24          Name = "Test Sphere "  .. i,
25          Path = "/Other/Spheres"
26        }
27      }
28
29      table.insert(spheres, Sphere)
30      i = i + 1
31    end
32  end
33end
34
35
36asset.onInitialize(function()
37  for _, n in ipairs(spheres) do
38    openspace.addSceneGraphNode(n)
39  end
40end)
41
42asset.onDeinitialize(function()
43  for _, n in ipairs(spheres) do
44    openspace.removeSceneGraphNode(n)
45  end
46end)
47
48
49for _, n in ipairs(spheres) do
50  asset.export(n)
51end
52
53
54asset.meta = {
55  Name = "Spheres Example",
56  Version = "1.0",
57  Description = [[Example showing how to render textured spheres in 3D space. Some
58    coding logic is used to generate 9 spheres with different size and position.]],
59  Author = "OpenSpace Team",
60  URL = "http://openspaceproject.com",
61  License = "MIT license"
62}