mirror of
https://github.com/OpenSpace/OpenSpace.git
synced 2026-04-28 14:59:31 -05:00
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
This commit is contained in:
@@ -0,0 +1,18 @@
|
||||
local fn =
|
||||
"return function (x, y, z) " ..
|
||||
" if math.sqrt(x^2 + y^2 + z^2) < 0.4 then " ..
|
||||
" return 0.8 " ..
|
||||
" end " ..
|
||||
" return 0.0 " ..
|
||||
"end"
|
||||
|
||||
return {{
|
||||
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:00",
|
||||
RawVolumeOutput = "${DATA}/assets/examples/volume/generated/cartesian/cartesian.rawvolume",
|
||||
DictionaryOutput = "${DATA}/assets/examples/volume/generated/cartesian/cartesian.dictionary"
|
||||
}}
|
||||
@@ -0,0 +1,27 @@
|
||||
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
|
||||
@@ -0,0 +1,15 @@
|
||||
local fn =
|
||||
"return function (r, phi, theta) " ..
|
||||
" return 1 - math.floor(r*10)/10 " ..
|
||||
"end"
|
||||
|
||||
return {{
|
||||
Type = "GenerateRawVolumeTask",
|
||||
Dimensions = {32, 32, 32},
|
||||
LowerDomainBound = {0, 0, 0},
|
||||
UpperDomainBound = {1, math.pi, 2 * math.pi},
|
||||
ValueFunction = fn,
|
||||
Time = "2018-05-04T00:00:00",
|
||||
RawVolumeOutput = "${DATA}/assets/examples/volume/generated/spherical/spherical.rawvolume",
|
||||
DictionaryOutput = "${DATA}/assets/examples/volume/generated/spherical/spherical.dictionary"
|
||||
}}
|
||||
Reference in New Issue
Block a user