In [ ]:
import k3d
import numpy as np

X, Y, Z = np.mgrid[:30, :30, :30]
# scaled distance from the "center" (15, 15, 15) of this scalar field
scalar_field = ((X-15.0)/15.0)**2 + ((Y-15.0)/15.0)**2 + ((Z-15.0)/15.0)**2

plot = k3d.plot()
plot += k3d.marching_cubes(scalar_field.astype(np.float32), level=0.8)
plot.display()
In [ ]:
plot.objects[0].level = 0.5
In [ ]:
plot.objects[0].wireframe = True
In [ ]:
plot.objects[0].flat_shading = False
In [ ]:
plot.camera_no_pan = True
In [ ]:
plot.camera_no_rotate = True
In [ ]:
plot.camera_no_zoom = True
In [ ]:
plot.camera_no_pan = False
plot.camera_no_rotate = False
plot.camera_no_zoom = False
In [ ]: