Files
OpenSpace/data/assets/examples/globetranslation.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

75 lines
1.6 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 ExampleFixedHeight = {
Identifier = "ExampleFixedHeight",
Parent = earth.Earth.Identifier,
Transform = {
Translation = {
Type = "GlobeTranslation",
Globe = earth.Earth.Identifier,
Latitude = 40.7128,
Longitude = -74.006,
Altitude = 100000.0
}
},
Renderable = {
Type = "RenderableModel",
GeometryFile = models .. "NewHorizonsCleanModel.obj",
LightSources = {
sun.LightSource
}
},
GUI = {
Path = "/Example"
}
}
local ExampleAdaptiveHeight = {
Identifier = "ExampleAdaptiveHeight",
Parent = earth.Earth.Identifier,
Transform = {
Translation = {
Type = "GlobeTranslation",
Globe = earth.Earth.Identifier,
Latitude = 40.7128,
Longitude = -74.006,
UseHeightmap = true
}
},
Renderable = {
Type = "RenderableModel",
GeometryFile = models .. "NewHorizonsCleanModel.obj",
LightSources = {
sun.LightSource
}
},
GUI = {
Path = "/Example"
}
}
asset.onInitialize(function()
openspace.addSceneGraphNode(ExampleFixedHeight)
openspace.addSceneGraphNode(ExampleAdaptiveHeight)
end)
asset.onDeinitialize(function()
openspace.removeSceneGraphNode(ExampleAdaptiveHeight)
openspace.removeSceneGraphNode(ExampleFixedHeight)
end)
asset.export(ExampleFixedHeight)
asset.export(ExampleAdaptiveHeight)