In [ ]:
from k3d import K3D
from math import sin, cos, pi

plot = K3D()
view_matrix = (
    (1.0, 0.0, 3.0, -0.5),
    (0.0, 1.0, -1.0, 0.0),
    (0.0, 0.0, 1.0, 27.5),
    (0.0, 0.0, 0.0, 0.0)
)
res = 100
scalars_field = (
    round(0.25 * sin(float(x)/res * 2*pi) + 0.25 * cos(float(y)/res * 2*pi), 3) for x in range(res) for y in range(res)
)
plot += K3D.surface(view_matrix, scalars_field, resolution=res)
plot.display()