mirror of
https://github.com/OpenSpace/OpenSpace.git
synced 2026-01-21 03:29:40 -06:00
39 lines
1.2 KiB
Plaintext
39 lines
1.2 KiB
Plaintext
-- This asset requires OpenSpace to be built with the OPENSPACE_MODULE_VOLUME enabled
|
|
|
|
-- Before using this example,
|
|
-- the volume data itself needs to be generated,
|
|
-- using the task 'data/tasks/volume/generate_cartesian_sequence.task'
|
|
|
|
local assetHelper = asset.require('util/asset_helper')
|
|
local transforms = asset.require("scene/solarsystem/sun/transforms")
|
|
|
|
local sunRadius = 695508000
|
|
|
|
local volume = {
|
|
Identifier = "GeneratedVolume",
|
|
Parent = transforms.SolarSystemBarycenter.Identifier,
|
|
Renderable = {
|
|
Type = "RenderableTimeVaryingVolume",
|
|
SourceDirectory = asset.localResource("cartesiansequence"),
|
|
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"
|
|
},
|
|
Transform = {
|
|
Scale = {
|
|
Type = "StaticScale",
|
|
Scale = 1000 * sunRadius
|
|
}
|
|
}
|
|
}
|
|
|
|
local objects = { volume }
|
|
assetHelper.registerSceneGraphNodes(asset, objects)
|