Files
OpenSpace/data/scene/default.scene
2017-11-09 10:26:17 -05:00

149 lines
5.3 KiB
Plaintext

-- Add folders to this list that contain .info files describing HiRISE patches
local vrt_folders = {
Mars = {
-- Add folders here whose contents will be automatically added to the Mars globe
-- If multiple folders are added, the results will be added sequentially, meaning that
-- if areas overlap (for example CTX and HiRISE) and CTX is specified *after* HiRISE,
-- CTX will stomp over the HiRISE
--
-- tl;dr: Specify CTX folders first, then HiRISE
-- example: 'C:/OpenSpace/GlobeBrowsingData/Mars/CTX'
},
Moon = {
-- Add folders here whose contents will be automatically added to the Moon globe
-- If multiple folders are added, the results will be added sequentially, meaning that
-- if areas overlap, images from the lower results will overwrite the images from former
-- results
-- example: 'C:/OpenSpace/GlobeBrowsingData/Moon'
}
}
dofile(openspace.absPath('${SCRIPTS}/scene_helper.lua'))
function preInitialization()
--[[
The scripts in this function are executed after the scene is loaded but before the
scene elements have been initialized, thus they should be used to set the time at
which the scene should start and other settings that might determine initialization
critical objects.
]]--
openspace.spice.loadKernel("${SPICE}/naif0012.tls")
openspace.spice.loadKernel("${SPICE}/pck00010.tpc")
openspace.time.setTime(openspace.time.currentWallTime())
dofile(openspace.absPath('${SCRIPTS}/bind_common_keys.lua'))
-- Toggle night texture, shading, atmosphere and water
openspace.bindKey("s",
helper.property.invert('Earth.RenderableGlobe.Layers.NightLayers.Earth at Night 2012.Enabled') ..
helper.property.invert('Earth.RenderableGlobe.PerformShading') ..
helper.property.invert('Earth.RenderableGlobe.Atmosphere') ..
helper.property.invert('Earth.RenderableGlobe.Layers.WaterMasks.MODIS_Water_Mask.Enabled'),
"Toggle night texture, shading, atmosphere, and water for Earth."
)
-- Toggle background
openspace.bindKey("b",
helper.property.invert('MilkyWay.renderable.Enabled') ..
helper.property.invert('Stars.renderable.Enabled'),
"Toggle background (Stars and Milkyway)."
)
openspace.bindKey("g",
helper.property.invert('MilkyWay.renderable.Enabled') ..
helper.property.invert('Stars.renderable.Enabled') ..
helper.property.invert('Earth.RenderableGlobe.Layers.NightLayers.Earth at Night 2012.Enabled') ..
helper.property.invert('Earth.RenderableGlobe.PerformShading') ..
helper.property.invert('Mars.RenderableGlobe.PerformShading') ..
helper.property.invert('Earth.RenderableGlobe.Atmosphere') ..
helper.property.invert('Earth.RenderableGlobe.Layers.WaterMasks.MODIS_Water_Mask.Enabled') ..
helper.property.invert('Moon.RenderableGlobe.Enabled') ..
helper.property.invert('Sun.renderable.Enabled'),
"Toogles background and shading mode on the Earth and Mars alongside visibility of the Moon and the Sun"
)
openspace.bindKey("h",
"openspace.setPropertyValue('*Trail.renderable.Enabled', false)",
"Disables visibility of the trails"
)
openspace.globebrowsing.loadWMSServersFromFile(
openspace.absPath("${OPENSPACE_DATA}/globebrowsing_servers.lua")
)
end
function postInitialization()
openspace.addVirtualProperty(
"BoolProperty",
"Show Trails",
"*Trail.renderable.Enabled",
"Disable or enable all trails of the scene at the same time",
true,
nil,
nil
)
openspace.printInfo("Setting default values")
openspace.setPropertyValueSingle("Global Properties.GlobeBrowsing.GdalWrapper.LogGdalErrors", false)
openspace.setPropertyValueSingle("Earth.RenderableGlobe.Debug.LevelByProjectedAreaElseDistance", false)
openspace.setPropertyValue("Earth.RenderableGlobe.Atmosphere", false)
openspace.setPropertyValue("Earth.RenderableGlobe.PerformShading", false)
openspace.setPropertyValue("Earth.RenderableGlobe.Layers.NightLayers.Earth at Night 2012.Settings.Multiplier", 1.0);
openspace.globebrowsing.goToGeo(58.5877, 16.1924, 20000000)
openspace.printInfo("Done setting default values")
openspace.setPropertyValue("RenderEngine.AaSamples", 4)
-- Add local patches described at the top of this file
for obj, list in pairs(vrt_folders) do
for _, dir in pairs(list) do
openspace.globebrowsing.addBlendingLayersFromDirectory(dir, obj)
end
end
-- Defined in scene_helper.lua
-- Used to create focus buttons for a subset of scenegraph nodes
mark_interesting_nodes({
"Earth", "EarthAtmosphere", "Mars", "MarsAtmosphere", "Moon"
})
end
return {
ScenePath = ".",
CommonFolder = "common",
Camera = {
Focus = "Earth",
Position = {0, 0, 0},
Rotation = {0.758797, 0.221490, -0.605693, -0.091135},
},
Modules = {
-- # Solar system objects
"sun",
"mercury",
"venus",
"earth",
"moon",
"mars",
"jupiter",
"saturn",
"uranus",
"neptune",
--"satellites",
"grids",
"digitaluniverse",
"stars/digitaluniverse",
"milkyway/digitaluniverse"
}
}