TimelineScale

Inherits Scale

This Scale uses a timeline of other Scale classes to calculate the final scale factor for the attached scene graph node. The current in-game time is used to determine which specific keyframe to currently use. It is also possible to interpolate between two adjacent keyframes.

Members

Name

Documentation

Type

Description

Optional

Keyframes

A table of keyframes, with keys formatted as YYYY-MM-DDTHH:MM:SS and values that are valid Scale objects.

Table

Table parameters

No

ShouldInterpolate

If this value is set to ‘true’, an interpolation is applied between the given keyframes. If this value is set to ‘false’, the interpolation is not applied.

Boolean

Value of type ‘Boolean’

Yes

Inherited members from Scale

Name

Documentation

Type

Description

Optional

Type

The type of the scaling that is described in this element. The available types of scaling depend on the configuration of the application and can be written to disk on application startup into the FactoryDocumentation

String

Must name a valid Scale type

No

TimeFrame

The time frame in which this Scale is applied. If the in-game time is outside this range, no scaling will be applied.

Table

TimeFrame

Yes

Table parameters for Keyframes

A table of keyframes, with keys formatted as YYYY-MM-DDTHH:MM:SS and values that are valid Scale objects.

  • Optional: No

Name

Documentation

Type

Description

Optional

*

Table

Scale

No

Asset Examples

No Interpolation

This asset creates a scene graph node that only displays coordinate axes. The scale of the coordinate axes are determined by a timeline of individual scales that are used without interpolating between the timeline entries. These scales are keyframes that are used to change between different sizes. This example transitions between three sizes. In this example, the interpolation between entries is disabled, which will cause the coordinate axes to change their size abruptly when the scale changes. If the interpolation were enabled, the orientation of the coordinate axes would transition seamlessly instead at the provided times. This example will only work if the in-game time is set to January 1st, 2000.

 1local Node = {
 2  Identifier = "TimelineScale_Example_NoInterpolation",
 3  Transform = {
 4    Scale = {
 5      Type = "TimelineScale",
 6      Keyframes = {
 7        -- The first timeline entry
 8        ["2000 JAN 01 00:00:00"] = {
 9          Type = "StaticScale",
10          Scale = 20.0
11        },
12        -- The second timeline entry
13        ["2000 JAN 01 12:00:00"] = {
14          Type = "StaticScale",
15          Scale = 10.0
16        },
17        -- The third timeline entry
18        ["2000 JAN 01 23:59:59"] = {
19          Type = "StaticScale",
20          Scale = 20.0
21        }
22      },
23      ShouldInterpolate = false
24    }
25  },
26  Renderable = {
27    Type = "RenderableCartesianAxes"
28  },
29  GUI = {
30    Name = "TimelineScale - No Interpolation",
31    Path = "/Examples"
32  }
33}
34
35asset.onInitialize(function()
36  openspace.addSceneGraphNode(Node)
37end)
38
39asset.onDeinitialize(function()
40  openspace.removeSceneGraphNode(Node)
41end)
No Interpolation

This asset creates a scene graph node that only displays coordinate axes whose scale is determined by a timeline of individual scales that are used without interpolating between the timeline entries. These scales are keyframes that are used to change between different sizes.

This example transitions between three sizes, but as the interpolation between entries is disabled, it will cause the coordinate axes to change their size abruptly when the scale changes. If the interpolation were enabled, the orientation of the coordinate axes would transition seamlessly instead at the provided times. This example will only work if the in-game time is set to January 1st, 2000.

 1local Node = {
 2  Identifier = "TimelineScale_Example_NoInterpolation",
 3  Transform = {
 4    Scale = {
 5      Type = "TimelineScale",
 6      Keyframes = {
 7        -- The first timeline entry
 8        ["2000 JAN 01 00:00:00"] = {
 9          Type = "StaticScale",
10          Scale = 10.0
11        },
12        -- The second timeline entry
13        ["2000 JAN 01 12:00:00"] = {
14          Type = "StaticScale",
15          Scale = 0.0
16        },
17        -- The third timeline entry
18        ["2000 JAN 01 23:59:59"] = {
19          Type = "StaticScale",
20          Scale = -10.0
21        }
22      },
23      ShouldInterpolate = false
24    }
25  },
26  Renderable = {
27    Type = "RenderableCartesianAxes"
28  },
29  GUI = {
30    Name = "TimelineScale - No Interpolation",
31    Path = "/Examples"
32  }
33}
34
35asset.onInitialize(function()
36  openspace.addSceneGraphNode(Node)
37end)
38
39asset.onDeinitialize(function()
40  openspace.removeSceneGraphNode(Node)
41end)
Basic

This asset creates a scene graph node that only displays coordinate axes. The scale of the coordinate axes are determined by a timeline of individual scales. These scales are keyframes that are used to seamlessly change between different sizes. This example transitions between three scales over a long time span. This example will only work if the in-game time is set to January 1st, 2000.

 1local Node = {
 2  Identifier = "TimelineScale_Example",
 3  Transform = {
 4    Scale = {
 5      Type = "TimelineScale",
 6      Keyframes = {
 7        -- The first timeline entry
 8        ["2000 JAN 01 00:00:00"] = {
 9          Type = "StaticScale",
10          Scale = 10.0
11        },
12        -- The second timeline entry
13        ["2000 JAN 01 12:00:00"] = {
14          Type = "StaticScale",
15          Scale = 0.0
16        },
17        -- The third timeline entry
18        ["2000 JAN 01 23:59:59"] = {
19          Type = "StaticScale",
20          Scale = -10.0
21        }
22      }
23    }
24  },
25  Renderable = {
26    Type = "RenderableCartesianAxes"
27  },
28  GUI = {
29    Name = "TimelineScale - Basic",
30    Path = "/Examples"
31  }
32}
33
34asset.onInitialize(function()
35  openspace.addSceneGraphNode(Node)
36end)
37
38asset.onDeinitialize(function()
39  openspace.removeSceneGraphNode(Node)
40end)