from k3d import K3D
import numpy
from math import sin, cos, pi
view_matrix = (
10.0, 2.0, -20.0, 0.0,
0.0, 10.0, 0.0, 5.0,
0.0, 0.0, 10.0, 0.0,
0.0, 0.0, 0.0, 1.0
)
width = height = 100
scalars_field = []
for x in range(width):
for y in range(height):
scalars_field.append(round(0.25 * sin(float(x)/width * 2*pi) + 0.25 * cos(float(y)/height * 2*pi), 3))
plot = K3D()
plot += K3D.surface(scalars_field, width, height, view_matrix, color=0xFF0000)
plot.display()