Files
OpenSpace/data/assets/examples/globerotation.asset
T
Alexander Bock 705c898ccd Asset File cleanup (#2713)
* Updating all assets to new coding style
* Cleaning up asset files
* Moving default_actions and default_keybindings files
* Changing procedural globes to explicitly specified globes
* Move Spice loading explicitly to the initialize part and also deinitialize
* Removing unused asset files
  * Removing asset_helper
  * Removing scale_model_helper asset
  * Removing script_scheduler_helper
  * Removing testing_keybindings
  * Remove procedural_globe
2023-05-28 17:23:20 +02:00

58 lines
1.3 KiB
Lua

local sun = asset.require("scene/solarsystem/sun/sun")
local earth = asset.require("scene/solarsystem/planets/earth/earth")
local models = asset.syncedResource({
Name = "New Horizons Model",
Type = "HttpSynchronization",
Identifier = "newhorizons_model",
Version = 2
})
local ExampleGlobeRotation = {
Identifier = "ExampleGlobeRotation",
Parent = earth.Earth.Identifier,
Transform = {
Translation = {
Type = "GlobeTranslation",
Globe = earth.Earth.Identifier,
Latitude = 40.7306,
Longitude = -73.9352,
Altitude = 6,
UseHeightmap = true
},
Rotation = {
Type = "GlobeRotation",
Globe = earth.Earth.Identifier,
Latitude = 40.7306,
Longitude = -73.9352
-- Can be used to to put flat on leaning surfaces, but also leads to updating
-- the rotation every frame
--UseHeightmap = true
}
},
Renderable = {
Type = "RenderableModel",
GeometryFile = models .. "NewHorizonsCleanModel.obj",
LightSources = {
sun.LightSource
}
},
GUI = {
Path = "/Example"
}
}
asset.onInitialize(function()
openspace.addSceneGraphNode(ExampleGlobeRotation)
end)
asset.onDeinitialize(function()
openspace.removeSceneGraphNode(ExampleGlobeRotation)
end)
asset.export(ExampleGlobeRotation)