timscaffidi/ofxVolumetrics

perhaps not an issue...

Opened this issue · 1 comments

Just wanted to say thanks for the nice addon.

I added the addon to Ofelia and adapted your example: https://github.com/Jonathhhan/volumetrics_anaglyph_example_ofelia

And i found a way to load data with a single loop (it looks a bit different, because i use OF with Lua bindings):

...
imageSequence:init(dataDir, 3, ".png", 1);
volWidth = imageSequence:getWidth();
volHeight = imageSequence:getHeight();
volDepth = imageSequence:getSequenceLength();
print("volWidth:", volWidth, "volHeight:", volHeight, "volDepth:", volDepth, "size:", volWidth * volHeight * volDepth * 4);
volumetrics:setup(volWidth, volHeight, volDepth, ofVec3f(1, 1, 2), true);
volumetrics:setRenderSettings(1.0, 1, 0.75, 0.1);
for z = 0, volDepth -1 do;
imageSequence:loadFrame(z);
pix = imageSequence:getPixels();
pix:setImageType(OF_IMAGE_COLOR_ALPHA);
pix:setChannel(4, imageSequence:getPixels());
volumetrics:loadVolumeData(pix:getData(), volWidth, volHeight, 1, 0, 0, z);
end;
...

And I have a question. Do you think it is possible to program a 3d game of life with your addon? I made one with a 2d texture and like to transfer it to 3d space: https://github.com/Jonathhhan/PDGameofLife-shaderVersion-
Perhaps this could be helpful for my attempt: https://github.com/wasawi/ofxVolume

Kind regards, Jonathan

Now I can answer my own question - it is possible: https://github.com/Jonathhhan/PureDataGameOfLife3d
Do you know if it is possible to draw the whole 3d texture created with your addon, after manipulating it with a shader ,into an ofFbo (or another gpu buffer)? Right now I use an ofPixels array as a buffer, which is not very efficient, because I need to copy the whole texture every frame from gpu to cpu and back (but still, with a 256x256x23 texture it works quite well).