- See "Canvas K3D TODO list" on Google Docs: https://docs.google.com/document/d/1_ST52vnfKHd3mFe0MmomseIhNIuvKT-k5RXsT5KRM00/edit Simple Cube: init( [{x:-1,y:1,z:-1}, {x:1,y:1,z:-1}, {x:1,y:-1,z:-1}, {x:-1,y:-1,z:-1}, {x:-1,y:1,z:1}, {x:1,y:1,z:1}, {x:1,y:-1,z:1}, {x:-1,y:-1,z:1}], [{a:0,b:1}, {a:1,b:2}, {a:2,b:3}, {a:3,b:0}, {a:4,b:5}, {a:5,b:6}, {a:6,b:7}, {a:7,b:4}, {a:0,b:4}, {a:1,b:5}, {a:2,b:6}, {a:3,b:7}], [{color:[255,0,0],vertices:[0,1,2,3]},{color:[0,255,0],vertices:[0,4,5,1]},{color:[0,0,255],vertices:[1,5,6,2]},{color:[255,255,0],vertices:[2,6,7,3]},{color:[0,255,255],vertices:[3,7,4,0]},{color:[255,0,255],vertices:[7,6,5,4]}] ); Icosahedron: var obj = new K3D.K3DObject(); var t = (1+Math.sqrt(5))/2; var tau = t/Math.sqrt(1+t*t); var one = 1/Math.sqrt(1+t*t); obj.ophi = (360 / j) * i; obj.otheta = (180 / j) * i; with (obj) { drawmode = "solid"; shademode = "lightsource"; addgamma = 0.5; addtheta = -0.75; addphi = 0.4; aboutx = 100; abouty = -100; aboutz = -25; scale = 20; init( [{x:tau,y:one,z:0}, {x:-tau,y:one,z:0}, {x:-tau,y:-one,z:0}, {x:tau,y:-one,z:0}, {x:one,y:0,z:tau}, {x:one,y:0,z:-tau}, {x:-one,y:0,z:-tau}, {x:-one,y:0,z:tau}, {x:0,y:tau,z:one}, {x:0,y:-tau,z:one}, {x:0,y:-tau,z:-one}, {x:0,y:tau,z:-one}], [], [{vertices:[4, 8, 7]}, {vertices:[4, 7, 9]}, {vertices:[5, 6, 11]}, {vertices:[5, 10, 6]}, {vertices:[0, 4, 3]}, {vertices:[0, 3, 5]}, {vertices:[2, 7, 1]}, {vertices:[2, 1, 6]}, {vertices:[8, 0, 11]}, {vertices:[8, 11, 1]}, {vertices:[9, 10, 3]}, {vertices:[9, 2, 10]}, {vertices:[8, 4, 0]}, {vertices:[11, 0, 5]}, {vertices:[4, 9, 3]}, {vertices:[5, 3, 10]}, {vertices:[7, 8, 1]}, {vertices:[6, 1, 11]}, {vertices:[7, 2, 9]}, {vertices:[6, 10, 2]}] ); } k3dmain1.addK3DObject(obj); // distribute points on the surface of a sphere in a spiral var N = 512; var pts = [], edges = []; var s = 3.6/Math.sqrt(N); var len = 0; var dz = 2.0/N; var z = 1 - dz/2; for (var k=0; k