Following the 3D matrix representation shown here Vitaliy Kaurov's answer for "Plot 3D boolean Array or matrix in Mathematica"
Is it possible to use a SparseArray in the same method?
M=RandomReal[{0},{10,10,10}];
M[[5,5,5]]=1;
s=SparseArray[M2];
bM=s/.x_->UnitStep[x-.5];
Graphics3D[{Hue[RandomReal[0.96]],{Opacity[0.65],Sphere[#,0.5]}&/@Position[bM,1]}]
However, this doesn't plot anything
On a side note what is the size limit of 3D matrices to be manipulated efficiently?
Position[bM, 1]doesn't work whenbMis a sparse array. The linked question should help you work around this. – Carl Woll Mar 23 '18 at 17:30
– Teabelly Mar 23 '18 at 17:41bM = s /. x_ -> UnitStep[x - .5]; Graphics3D[{Hue[RandomReal[0.96]], {Opacity[0.65], Sphere[#, 0.5]} & /@ bM["NonzeroPositions"]}]works nicely :)