In [1]:
import k3d
import k3d.platonic as platonic
import math
import numpy as np

def test(plot):
    colors = [0xff0000, 0x00ff00, 0x0000ff, 0xffff00, 0xff00ff]

    for j in range(5):
        meshes = [
            platonic.Dodecahedron().mesh,
            platonic.Cube().mesh,
            platonic.Icosahedron().mesh,
            platonic.Octahedron().mesh,
            platonic.Tetrahedron().mesh
        ]

        for i, obj in enumerate(meshes):
            rad = math.radians(i / len(meshes) * 360)
            radius = 3.5
            obj.transform.translation = [math.sin(rad) * radius, math.cos(rad) * radius, 2*j]
            obj.color = colors[i]
            plot += obj

    plot.render()
In [2]:
plot = k3d.plot()
plot.display()
In [13]:
plot.auto_rendering = True
In [4]:
test(plot)
In [5]:
while plot.objects:
    plot -= plot.objects[-1]

plot.render()
In [14]:
plot.auto_rendering = False
In [7]:
while len(plot.objects)>2:
    plot -= plot.objects[-1]
In [12]:
plot.render()
In [9]:
import numpy as np 
In [10]:
for i in range(10):
    plot += k3d.points(np.random.randn(1,3))#,color=0xff0000)
    plot.camera = [-0.9639876204909027,
         -23.61169267956684,
         i,
         0,
         0.334220290184021,
         4,
         0.007512009764659415,
         0.3054834418666324,
         0.9521677564665881]
/Users/marcin/anaconda3/envs/minimal/lib/python3.7/site-packages/traittypes/traittypes.py:101: UserWarning: Given trait value dtype "float64" does not match required type "float32". A coerced copy has been created.
  np.dtype(self.dtype).name))
In [50]:
plot.render()
In [11]:
for i in range(100):
    plot.camera = [940.698323963372,
     -1632.233209973555,
     i*10,
     4.949999809265137,
     -490.04998779296875,
     49.005001068115234,
     0.008397615690103343,
     0.012813759314055312,
     0.9998826369244359]
In [ ]: