RenderableSphereImageLocal
Inherits Renderable
Members
Name |
Documentation |
Type |
Description |
Optional |
---|---|---|---|---|
|
This value specifies the number of segments that the sphere is separated in |
|
Value of type ‘Integer’ |
No |
|
This value specifies the radius of the sphere in meters |
|
Value of type ‘Double’ |
No |
|
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 |
|
Value of type ‘String’ |
No |
|
Enables/Disables the fade in and out effects |
|
Value of type ‘Boolean’ |
Yes |
|
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 |
|
Value of type ‘Double’ |
Yes |
|
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 |
|
In range: ( 0,1 ) |
Yes |
|
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 |
|
Value of type ‘Boolean’ |
Yes |
|
Mirror the texture along the x-axis |
|
Value of type ‘Boolean’ |
Yes |
|
Specifies whether the texture is applied to the inside of the sphere, the outside of the sphere, or both |
|
In list { Outside, Inside, Both } |
Yes |
Inherited members from Renderable
Name |
Documentation |
Type |
Description |
Optional |
---|---|---|---|---|
|
Enables/Disables if the object should be dimmed when the camera is in the sunny part of an atmosphere |
|
Value of type ‘Boolean’ |
Yes |
|
This setting 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 |
|
This value specifies if the renderable should be rendered in the Background,Opaque, Pre/PostDeferredTransparency, or Overlay rendering step |
|
In list { Background, Opaque, PreDeferredTransparent, PostDeferredTransparent, Overlay } |
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 |
|
This tells the type of the renderable |
|
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}