SpiceRotation
Inherits Rotation
This Rotation type uses SPICE kernels to provide rotation information for the attached scene graph node. SPICE is a library used by scientists and engineers to, among other tasks, plan space missions. If you are unfamiliar with SPICE, their webpage has both extensive Tutorials as well as Lessions that explain the system deeper. This class provides access to the pxform_c function of the Spice library.
Members
Name |
Documentation |
Type |
Description |
Optional |
|---|---|---|---|---|
|
This value specifies the source frame that is used as the basis for the coordinate transformation. This has to be a valid SPICE name. |
|
A valid SPICE NAIF name or integer |
No |
|
This value specifies the destination frame that is used for the coordinate transformation. This has to be a valid SPICE name. If this value is not specified, a reference frame of ‘GALACTIC’ is used instead |
|
Value of type ‘String’ |
Yes |
|
A time to lock the rotation to. Setting this to an empty string will unlock the time and return to rotation based on current simulation time. |
|
Value of type ‘Date and time’ |
Yes |
|
A time offset, in seconds, added to the simulation time (or Fixed Date if any), at which to compute the rotation. |
|
Value of type ‘Double’ |
Yes |
Inherited members from Rotation
Name |
Documentation |
Type |
Description |
Optional |
|---|---|---|---|---|
|
The type of the rotation that is described in this element. The available types of rotations depend on the configuration of the application and can be written to disk on application startup into the FactoryDocumentation |
|
Must name a valid Rotation type |
No |
|
The time frame in which this |
|
Yes |
Asset Examples
Basic
This asset creates a rotation provided by a SPICE kernel and applies it to a scene graph node that only displays coordinate axes. The rotation of the coordinate axes are determined by SPICE, in this case pretending that the coordinate axes are rotating at the same rate as Earth. For more information about SPICE see: https://naif.jpl.nasa.gov/naif/
1-- Load the default SPICE kernels, which are the planetary constants and the DE430 kernel
2asset.require("spice/core")
3
4local Node = {
5 Identifier = "SpiceRotation_Example",
6 Transform = {
7 Rotation = {
8 Type = "SpiceRotation",
9 SourceFrame = "IAU_EARTH",
10 DestinationFrame = "GALACTIC"
11 }
12 },
13 Renderable = {
14 Type = "RenderableCartesianAxes"
15 },
16 GUI = {
17 Name = "SpiceRotation - Basic",
18 Path = "/Examples"
19 }
20}
21
22asset.onInitialize(function()
23 openspace.addSceneGraphNode(Node)
24end)
25
26asset.onDeinitialize(function()
27 openspace.removeSceneGraphNode(Node)
28end)
Time offset
This asset creates a rotation provided by a SPICE kernel and applies it to a scene graph node that only displays coordinate axes. The rotation of the coordinate axes are determined by SPICE, in this case pretending that the coordinate axes are rotating at the same rate as Earth. In this specific example, the orientation is offset 8h back compared to the actual in-game time in OpenSpace.
1-- Load the default SPICE kernels, which is the planetary constants and the DE430 kernel
2asset.require("spice/core")
3
4local Node = {
5 Identifier = "SpiceRotation_Example_TimeOffset",
6 Transform = {
7 Rotation = {
8 Type = "SpiceRotation",
9 SourceFrame = "IAU_EARTH",
10 DestinationFrame = "GALACTIC",
11 TimeOffset = -8 * 60 * 60
12 }
13 },
14 Renderable = {
15 Type = "RenderableCartesianAxes"
16 },
17 GUI = {
18 Name = "SpiceRotation - Time Offset",
19 Path = "/Examples"
20 }
21}
22
23asset.onInitialize(function()
24 openspace.addSceneGraphNode(Node)
25end)
26
27asset.onDeinitialize(function()
28 openspace.removeSceneGraphNode(Node)
29end)
TimeFrame
This asset creates a rotation provided by a SPICE kernel and applies it to a scene graph node that only displays coordinate axes. The rotation of the coordinate axes are determined by SPICE, in this case pretending that the coordinate axes are rotating at the same rate as Earth. In this example, the rotation is only calculated between 2000 JAN 01 and 2002 JAN 01 to exemplify a use-case in which the data from the SPICE kernel is not available for the whole duration.
1-- Load the default SPICE kernels, which is the planetary constants and the DE430 kernel
2asset.require("spice/core")
3
4local Node = {
5 Identifier = "SpiceRotation_Example_TimeFrame",
6 Transform = {
7 Rotation = {
8 Type = "SpiceRotation",
9 SourceFrame = "IAU_EARTH",
10 DestinationFrame = "GALACTIC",
11 TimeFrame = {
12 Type = "TimeFrameInterval",
13 Start = "2000 JAN 01",
14 End = "2002 JAN 01"
15 }
16 }
17 },
18 Renderable = {
19 Type = "RenderableCartesianAxes"
20 },
21 GUI = {
22 Name = "SpiceRotation - TimeFrame",
23 Path = "/Examples"
24 }
25}
26
27asset.onInitialize(function()
28 openspace.addSceneGraphNode(Node)
29end)
30
31asset.onDeinitialize(function()
32 openspace.removeSceneGraphNode(Node)
33end)
Fixed Date
This asset creates a rotation provided by a SPICE kernel and applies it to a scene graph node that only displays coordinate axes. The rotation of the coordinate axes are determined by SPICE, in this case pretending that the coordinate axes are rotating at the same rate as Earth. In this specific example, the orientation is independent of the actual in-game time in OpenSpace and only uses a fixed date of 2000 JAN 01 instead.
1-- Load the default SPICE kernels, which is the planetary constants and the DE430 kernel
2asset.require("spice/core")
3
4local Node = {
5 Identifier = "SpiceRotation_Example_FixedDate",
6 Transform = {
7 Rotation = {
8 Type = "SpiceRotation",
9 SourceFrame = "IAU_EARTH",
10 DestinationFrame = "GALACTIC",
11 FixedDate = "2000 JAN 01 00:00:00.000"
12 }
13 },
14 Renderable = {
15 Type = "RenderableCartesianAxes"
16 },
17 GUI = {
18 Name = "SpiceRotation - Fixed Date",
19 Path = "/Examples"
20 }
21}
22
23asset.onInitialize(function()
24 openspace.addSceneGraphNode(Node)
25end)
26
27asset.onDeinitialize(function()
28 openspace.removeSceneGraphNode(Node)
29end)