RenderableDisc
Inherits Renderable
Members
Name |
Documentation |
Type |
Description |
Optional |
---|---|---|---|---|
|
This value is the path to a texture on disk that contains a one-dimensional texture to be used for the color |
|
Value of type ‘File’ |
No |
|
This value specifies the outer radius of the disc in meter |
|
Value of type ‘Double’ |
Yes |
|
This value is used to set the width of the disc. The actual width is set based on the given size and this value should be set between 0 and 1. A value of 1 results in a full circle and 0.5 a disc with an inner radius of 0.5*size |
|
Value of type ‘Double’ |
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
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
56asset.meta = {
57 Name = "Example Discs",
58 Version = "1.0",
59 Description = [[Examples of different types of rendered discs.]],
60 Author = "OpenSpace Team",
61 URL = "http://openspaceproject.com",
62 License = "MIT license"
63}