mirror of
https://github.com/OpenSpace/OpenSpace.git
synced 2026-05-07 20:09:58 -05:00
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_spherical.task'
|
|
|
|
local transforms = asset.require("scene/solarsystem/sun/transforms")
|
|
|
|
|
|
|
|
local AstronomicalUnit = 149597870700
|
|
|
|
local Volume = {
|
|
Identifier = "GeneratedVolume",
|
|
Parent = transforms.SolarSystemBarycenter.Identifier,
|
|
Transform = {
|
|
Scale = {
|
|
Type = "StaticScale",
|
|
Scale = AstronomicalUnit
|
|
}
|
|
},
|
|
Renderable = {
|
|
Type = "RenderableTimeVaryingVolume",
|
|
SourceDirectory = asset.resource("spherical"),
|
|
TransferFunction = asset.resource("../transferfunction.txt"),
|
|
StepSize = 0.01,
|
|
MinValue = 0,
|
|
MaxValue = 1,
|
|
GridType = "Spherical",
|
|
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)
|