I am currently working on a numerical simulation of the flow of two fluids through porous digital rocks using C++. I have a binary file(1=rock,0=void) for the rock which has a 2D slice-based structure meaning that the data representing 10x10x10 rock will have 10 columns and 100 rows with every ten rows representing a slice of a 3D structure. And also the data on a separate file with the same structure representing the position of the fluid in the voids(0's) of that rock. I have already stacked the 2D array to 3D using python but I don't know how to plot this as voxels to visualize the 3D rock and the fluid inside of it. I tried 3D voxel plots using matplotlib but it turned to be so slow for a large chunk of data(1000x1000x1000). It does not seem a tough challenge, however, I cannot find a proper way to do it. All I want is a 3D voxel plot with some transparency adjustments which is not very slow. The file format which I write out from the simulation is just simple .dat format with containing space-separated float values. Below is a nice example of what I want to do.