Files
OpenSpace/data/tasks/volume/generate_cartesian_sequence.task
Emil Axelsson 5de728442d Feature/volume tools (#614)
* Create volume generation task

* Change domain bounds into a non-optional parameter

* Work on volume generation and rendering

* Example generation of time varying volume

* Example generation of time varying volume

* Compile fix in RenderableKameleonVolume

* Fix copy and paste error

* Enable spherical raycasting again

* Uniform naming

* Add some documentation and remove dead code
2018-06-08 09:47:24 -04:00

27 lines
922 B
Plaintext

local length = 60
local tasks = {}
for i=1,length do
local radius = 0.5 * (1 - i/length)
local step = string.format("%02d", i-1)
local fn =
"return function (x, y, z) " .. "\n" ..
" local v = math.sqrt(x^2 + y^2 + z^2) - " .. radius .. "\n" ..
" v = (-v - 0.1) / 0.2 " .. "\n" ..
" v = math.min(math.max(v, 0), 1) " .. "\n" ..
" v = 3*v^2 - 2*v^3 " .. "\n" ..
" return v" .. "\n" ..
"end"
tasks[#tasks+1] = {
Type = "GenerateRawVolumeTask",
Dimensions = {32, 32, 32},
LowerDomainBound = {-0.5, -0.5, -0.5},
UpperDomainBound = {0.5, 0.5, 0.5},
ValueFunction = fn,
Time = "2018-05-04T00:00:" .. step,
RawVolumeOutput = "${DATA}/assets/examples/volume/generated/cartesiansequence/" .. step .. ".rawvolume",
DictionaryOutput = "${DATA}/assets/examples/volume/generated/cartesiansequence/" .. step .. ".dictionary"
}
end
return tasks