Somakube (2).
En af Piet Heins somakuber. Du kan dreje figuren ved at trække med musen. Hvis du holder musen nede, skifter markøren, og du kan trække figuren. Du kan zoome med musehjulet (eller ved at pinche).
Figure3D figure = Position [0,0] Size [x,y] Origin [x/2,y/2] Unit x/12 Angles [30,-30,0] Color "white" Dynamic;
/*
Line xline = Start [ -4, 0, 0 ] Dir [ 8, 0, 0 ] Vector Size 1 Color "black";
Line yline = Start [ 0, -4, 0 ] Dir [ 0, 8, 0 ] Vector Size 1 Color "black";
Line zline = Start [ 0, 0, -4 ] Dir [ 0, 0, 8 ] Vector Size 1 Color "black";
Label xlabel = "x" At [4,0,0] Offset [0,0,0] Color "black";
Label ylabel = "y" At [0,4,0] Offset [0,0,0] Color "black";
Label zlabel = "z" At [0,0,4] Offset [0,0,0] Color "black";
*/
Net kube =
Points
[-1,-1,-1], [1,-1,-1], [1,1,-1], [-1,1,-1],
[-1,-1,1], [1,-1,1], [1,1,1], [-1,1,1]
Lines
[0,1], [1,2], [2,3], [3,0], [4,5], [5,6], [6,7], [7,4],
[0,4], [1,5], [2,6], [3,7]
Faces
[0,1,2,3], [4,5,6,7], [0,1,5,4], [1,2,6,5], [2,3,7,6], [3,0,4,7]
Constant;
Net kube1 = Translate kube [-1,-1,0] Constant;
Net kube2 = Translate kube [-1,1,0] Constant;
Net kube3 = Translate kube [1,-1,0] Constant;
Net kube4 = Translate kube [3,-1,0] Constant;
Net soma = Union kube1 kube2 kube3 kube4 Constant;
Scene scene = soma Color "black" "#c0c0c0";