RenderablePrism
Inherits Renderable
Renders a prism shape defined by two polygonal shapes (base and top) connected by lines. The number of polygon segments is determined by the Segments property, with the same number being used for both the base and the top.
Members
Name |
Documentation |
Type |
Description |
Optional |
|---|---|---|---|---|
|
The number of segments the shape of the prism should have. |
|
Greater or equal to: 3 |
No |
|
The radius of the base of the prism’s shape, in meters. By default it is given the same radius as the outer shape. |
|
Greater or equal to: 0 |
Yes |
|
The RGB color of the line. |
|
Value of type ‘Color3’ |
Yes |
|
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 |
|
The length of the prism in meters. |
|
Greater or equal to: 0 |
Yes |
|
The number of lines connecting the two shapes of the prism. They will be evenly distributed around the bounding circle that makes up the shape of the prism. |
|
Greater or equal to: 0 |
Yes |
|
The width of the lines. The larger number, the thicker the lines. |
|
Greater or equal to: 0 |
Yes |
|
This value determines the opacity of this renderable. A value of 0 means completely transparent. |
|
In range: ( 0, 1) |
Yes |
|
The radius of the prism’s shape in meters. |
|
Greater or equal to: 0 |
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 |
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 |
Asset Examples
1local transforms = asset.require("./transforms")
2local model = asset.require("./model")
3
4
5
6local JWSTFov = {
7 Identifier = "JWSTFov",
8 Parent = model.JWSTModel.Identifier,
9 TimeFrame = {
10 Type = "TimeFrameInterval",
11 Start = transforms.LaunchTime
12 },
13 Renderable = {
14 Type = "RenderablePrism",
15 Enabled = asset.enabled,
16 Segments = 6,
17 Lines = 3,
18 Radius = 3.25,
19 LineWidth = 1.0,
20 Color = { 1.0, 1.0, 1.0 },
21 Length = 9.2E15
22 },
23 Transform = {
24 Rotation = {
25 Type = "StaticRotation",
26 Rotation = { 0, 0, math.rad(30) }
27 }
28 },
29 Tag = { "mission_jwst_fov" },
30 GUI = {
31 Name = "JWST Field of View",
32 Path = "/Solar System/Telescopes/JWST",
33 Focusable = false,
34 Description = [[
35 The field of view for the James Webb Space Telescope at its current position.
36 ]]
37 }
38}
39
40
41asset.onInitialize(function()
42 openspace.addSceneGraphNode(JWSTFov)
43end)
44
45asset.onDeinitialize(function()
46 openspace.removeSceneGraphNode(JWSTFov)
47end)
48
49asset.export(JWSTFov)
50
51
52
53asset.meta = {
54 Name = "JWST Field of View",
55 Description = [[
56 The field of view for the James Webb Space Telescope at its current position.
57 ]],
58 Author = "OpenSpace Team",
59 URL = "https://openspaceproject.com",
60 License = "MIT license"
61}