mirror of
https://github.com/OpenSpace/OpenSpace.git
synced 2026-01-02 09:41:13 -06:00
Add examples for SpiceTranslation (#3376)
This commit is contained in:
36
data/assets/examples/rotation/spicerotation/fixeddate.asset
Normal file
36
data/assets/examples/rotation/spicerotation/fixeddate.asset
Normal file
@@ -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)
|
||||
34
data/assets/examples/rotation/spicerotation/spice.asset
Normal file
34
data/assets/examples/rotation/spicerotation/spice.asset
Normal file
@@ -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)
|
||||
41
data/assets/examples/rotation/spicerotation/timeframe.asset
Normal file
41
data/assets/examples/rotation/spicerotation/timeframe.asset
Normal file
@@ -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)
|
||||
Reference in New Issue
Block a user