RenderablePlaneImageLocal
Inherits Renderable
A RenderablePlaneImageLocal creates a textured 3D plane, where the texture is provided by a local file on disk.
Members
Name |
Documentation |
Type |
Description |
Optional |
|---|---|---|---|---|
|
The size of the plane in meters. |
|
Value of type ‘Double’, or Value of type ‘Vector2 |
No |
|
A path to an image file to use as a texture for the plane. |
|
Value of type ‘String’ |
No |
|
Decides whether the plane should automatically adjust in size to match the aspect ratio of the content. Otherwise it will remain in the given size. |
|
Value of type ‘Boolean’ |
Yes |
|
Controls whether the plane will be oriented as a billboard. Setting this value to |
|
Value of type ‘Boolean’, or In list { Camera View Direction, Camera Position Normal, Fixed Rotation } |
Yes |
|
Determines the blending mode that is applied to this plane. |
|
In list { Normal, Additive } |
Yes |
|
Settings for scaling points based on camera distance |
|
Yes |
|
|
If this value is set to true, the image for this plane will not be loaded at startup but rather when image is shown for the first time. Additionally, if the plane is hidden, the image will automatically be unloaded. |
|
Value of type ‘Boolean’ |
Yes |
|
If false, the image plane will not be mirrored when viewed from the backside. This is usually desirable when the image shows data at a specific location, but not if it is displaying text for example. |
|
Value of type ‘Boolean’ |
Yes |
|
An RGB color to multiply with the plane’s texture. Useful for applying a color to grayscale images. |
|
Value of type ‘Color3’ |
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 |
Table parameters for DistanceScalingSettings
Settings for scaling points based on camera distance
Optional: Yes
Name |
Documentation |
Type |
Description |
Optional |
|---|---|---|---|---|
|
Value that controls the visual size of the object when using distance scaling.A value of 1.0 results in a natural angular size based on camera distance and field of view. Smaller values (e.g., 0.01) make the object appear smaller, while larger values make it appear bigger. |
|
Greater than: 0 |
Yes |
|
Decides whether the plane should automatically adjust in size to based on the distance to the camera. Otherwise it will remain in the given size. |
|
Value of type ‘Boolean’ |
Yes |
|
The maximum height in meters a plane can get when using distance scaling. |
|
Greater than: 0 |
Yes |
|
The minimum height in meters a plane can get when using distance scaling. |
|
Greater than: 0 |
Yes |
Asset Examples
Basic
This example shows how to create a textured plane in 3D space, where the texture is loaded from a local file on disk.
1local Node = {
2 Identifier = "RenderablePlaneImageLocal_Example",
3 Renderable = {
4 Type = "RenderablePlaneImageLocal",
5 Size = 3.0E11,
6 Texture = openspace.absPath("${DATA}/test2.jpg")
7 },
8 GUI = {
9 Name = "RenderablePlaneImageLocal - Basic",
10 Path = "/Examples"
11 }
12}
13
14asset.onInitialize(function()
15 openspace.addSceneGraphNode(Node)
16end)
17
18asset.onDeinitialize(function()
19 openspace.removeSceneGraphNode(Node)
20end)
Scale by Distance to Camera
This example creates a textured plane that is scaled based on the distance to the camera, so that it stays a constant size in screen space. The scale is limited so that the plane does not become larger or smaller than a given max height and min height, in meters.
1local earth = asset.require("scene/solarsystem/planets/earth/earth")
2
3local Node = {
4 Identifier = "RenderablePlaneImageLocal_Example_ScaleByDistance",
5 Renderable = {
6 Type = "RenderablePlaneImageLocal",
7 Size = 100000,
8 Texture = openspace.absPath("${DATA}/test2.jpg"),
9 DistanceScalingSettings = {
10 ScaleByDistance = true,
11 ApparentSizeMultiplier = 0.01,
12 ScaleByDistanceMaxHeight = 200000,
13 ScaleByDistanceMinHeight = 30000
14 }
15 },
16 GUI = {
17 Name = "RenderablePlaneImageLocal - ScaleByDistance",
18 Path = "/Examples"
19 }
20}
21
22asset.onInitialize(function()
23 openspace.addSceneGraphNode(Node)
24end)
25
26asset.onDeinitialize(function()
27 openspace.removeSceneGraphNode(Node)
28end)
Billboard Image
This example shows how to create a textured plane in 3D space, where the texture is loaded from a local file on disk and the plane is billboarded to always face the camera.
1local Node = {
2 Identifier = "RenderablePlaneImageLocal_Example_Billboard",
3 Renderable = {
4 Type = "RenderablePlaneImageLocal",
5 Size = 3.0E11,
6 Texture = openspace.absPath("${DATA}/test2.jpg"),
7 Billboard = true
8 },
9 GUI = {
10 Name = "RenderablePlaneImageLocal - Billboard",
11 Path = "/Examples"
12 }
13}
14
15asset.onInitialize(function()
16 openspace.addSceneGraphNode(Node)
17end)
18
19asset.onDeinitialize(function()
20 openspace.removeSceneGraphNode(Node)
21end)