Paul Rudin <[email protected]> writes:
> def compute_voxels2(depth_buffers):
> dim = depth_buffers[0].shape[0]
> znear, zfar, ynear, yfar, xnear, xfar = depth_buffers
> z = numpy.arange(dim)
> y = numpy.arange(dim)[:, None]
> x = numpy.arange(dim)[:, None, None]
>
> return ((xnear[y,z] < xfar[y, z]) &
> (ynear[x, z] < yfar[x, z]) &
> (znear[x,y] < zfar[x,y]))
>
... or, more succinctly:
def compute_voxels2(znear, zfar, ynear, yfar, xnear, xfar):
return ( (xnear<xfar) &
(ynear < yfar)[:,None] &
(znear < zfar)[:, :, None])
>
> All that remains is for me to verify that it's actually the result I want :)
>
Which it is, although getting the 6 planes passed in oriented correctly
in 3d-space makes my head hurt :/
_______________________________________________
Numpy-discussion mailing list
[email protected]
http://projects.scipy.org/mailman/listinfo/numpy-discussion