mirror of
https://github.com/OpenSpace/OpenSpace.git
synced 2026-04-29 07:19:28 -05:00
705c898ccd
* 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
46 lines
1.0 KiB
Lua
46 lines
1.0 KiB
Lua
-- Before using this example,
|
|
-- the volume data itself needs to be generated,
|
|
-- using the task 'data/tasks/volume/generate_cartesian.task'
|
|
|
|
local transforms = asset.require("scene/solarsystem/sun/transforms")
|
|
|
|
|
|
|
|
local SunRadius = 695508000
|
|
|
|
local Volume = {
|
|
Identifier = "GeneratedVolume",
|
|
Parent = transforms.SolarSystemBarycenter.Identifier,
|
|
Transform = {
|
|
Scale = {
|
|
Type = "StaticScale",
|
|
Scale = 1000 * SunRadius
|
|
}
|
|
},
|
|
Renderable = {
|
|
Type = "RenderableTimeVaryingVolume",
|
|
SourceDirectory = asset.localResource("cartesian"),
|
|
TransferFunction = asset.localResource("../transferfunction.txt"),
|
|
StepSize = 0.01,
|
|
MinValue = 0,
|
|
MaxValue = 1,
|
|
GridType = "Cartesian",
|
|
SecondsBefore = 50 * 365 * 24 * 60 * 60, -- 50 years before
|
|
SecondsAfter = 50 * 365 * 24 * 60 * 60 -- 50 years after
|
|
},
|
|
GUI = {
|
|
Path = "/Examples"
|
|
}
|
|
}
|
|
|
|
|
|
asset.onInitialize(function()
|
|
openspace.addSceneGraphNode(Volume)
|
|
end)
|
|
|
|
asset.onDeinitialize(function()
|
|
openspace.removeSceneGraphNode(Volume)
|
|
end)
|
|
|
|
asset.export(Volume)
|