import k3d
import numpy as np
Nx = 240
Ny = 480
xmin, xmax = -3, 3
ymin, ymax = -0, 3
x = np.linspace(xmin, xmax, Nx)
y = np.linspace(ymin, ymax, Ny)
x, y = np.meshgrid(x, y)
heights = np.sin(x**2 + y**2).astype(np.float32)
plot = k3d.plot()
obj = k3d.surface(heights, xmin=xmin, xmax=xmax, ymin=ymin, ymax=ymax)
plot += obj
plot.display()
Output()
plot.camera = [2.93, -1.98, 4.33, 0, 1.5, 0, -0.37, 0.53, 0.76]
plot.objects[0].flat_shading = False
obj.attribute = heights
obj.color_range = [np.min(heights), np.max(heights)]
k3d.surface??