diff --git a/data/assets/examples/rotation/spicerotation/fixeddate.asset b/data/assets/examples/rotation/spicerotation/fixeddate.asset new file mode 100644 index 0000000000..d3c580a656 --- /dev/null +++ b/data/assets/examples/rotation/spicerotation/fixeddate.asset @@ -0,0 +1,36 @@ +-- Fixed Date +-- This asset creates a rotation provided by a SPICE kernel and applies it to a +-- SceneGraphNode 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. + +-- Load the default SPICE kernels, which is the planetary constants and the DE430 kernel +asset.require("spice/core") + +local Node = { + Identifier = "SpiceRotation_Example_FixedDate", + Transform = { + Rotation = { + Type = "SpiceRotation", + SourceFrame = "IAU_EARTH", + DestinationFrame = "GALACTIC", + FixedDate = "2000 JAN 01 00:00:00.000" + } + }, + Renderable = { + Type = "RenderableCartesianAxes" + }, + GUI = { + Name = "SpiceRotation - Fixed Date", + Path = "/Examples" + } +} + +asset.onInitialize(function() + openspace.addSceneGraphNode(Node) +end) + +asset.onDeinitialize(function() + openspace.removeSceneGraphNode(Node) +end) diff --git a/data/assets/examples/rotation/spicerotation/spice.asset b/data/assets/examples/rotation/spicerotation/spice.asset new file mode 100644 index 0000000000..e084dde9bb --- /dev/null +++ b/data/assets/examples/rotation/spicerotation/spice.asset @@ -0,0 +1,34 @@ +-- Basic +-- This asset creates a rotation provided by a SPICE kernel and applies it to a +-- SceneGraphNode 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. + +-- Load the default SPICE kernels, which is the planetary constants and the DE430 kernel +asset.require("spice/core") + +local Node = { + Identifier = "SpiceRotation_Example", + Transform = { + Rotation = { + Type = "SpiceRotation", + SourceFrame = "IAU_EARTH", + DestinationFrame = "GALACTIC" + } + }, + Renderable = { + Type = "RenderableCartesianAxes" + }, + GUI = { + Name = "SpiceRotation - Basic", + Path = "/Examples" + } +} + +asset.onInitialize(function() + openspace.addSceneGraphNode(Node) +end) + +asset.onDeinitialize(function() + openspace.removeSceneGraphNode(Node) +end) diff --git a/data/assets/examples/rotation/spicerotation/timeframe.asset b/data/assets/examples/rotation/spicerotation/timeframe.asset new file mode 100644 index 0000000000..6eb7eb3f90 --- /dev/null +++ b/data/assets/examples/rotation/spicerotation/timeframe.asset @@ -0,0 +1,41 @@ +-- TimeFrame +-- This asset creates a rotation provided by a SPICE kernel and applies it to a +-- SceneGraphNode 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. + +-- Load the default SPICE kernels, which is the planetary constants and the DE430 kernel +asset.require("spice/core") + +local Node = { + Identifier = "SpiceRotation_Example_TimeFrame", + Transform = { + Rotation = { + Type = "SpiceRotation", + SourceFrame = "IAU_EARTH", + DestinationFrame = "GALACTIC", + TimeFrame = { + Type = "TimeFrameInterval", + Start = "2000 JAN 01", + End = "2002 JAN 01" + } + } + }, + Renderable = { + Type = "RenderableCartesianAxes" + }, + GUI = { + Name = "SpiceRotation - TimeFrame", + Path = "/Examples" + } +} + +asset.onInitialize(function() + openspace.addSceneGraphNode(Node) +end) + +asset.onDeinitialize(function() + openspace.removeSceneGraphNode(Node) +end)