--> Intersection cube/plan









Xmin = -3 Xmax = -0.5 Ymin = -3 Ymax = -0.5 A = [0,0,0] B = [1,0,0] C = [1,1,0] D = [0,1,0] E = [0,0,1] F = [1,0,1] G = [1,1,1] H = [0,1,1] a = 0 eps = 0.005 setInterval(function (){ inter() },50) function inter(){ effaceEcran() couleur = noir segment(A,B,[3,3]) segment(B,C) segment(C,D) segment(D,A,[3,3]) segment(A,E,[3,3]) segment(B,F) segment(C,G) segment(D,H) segment(E,F) segment(F,G) segment(G,H) segment(H,E) if(3*a<1 && 3*a > 0){ point([3*a,0,0]) point([0,3*a,0]) point([0,0,3*a]) peinture = vert transparence = 0.3 poly([[3*a,0,0],[0,3*a,0],[0,0,3*a]]) } if(3*a-1<1 && 3*a-1 > 0){ point([1,3*a-1,0]) point([3*a-1,1,0]) point([3*a-1,0,1]) point([0,3*a-1,1]) point([1,0,3*a-1]) point([0,1,3*a-1]) peinture = vert transparence = 0.3 poly([[1,0,3*a-1],[1,3*a-1,0],[3*a-1,1,0],[0,1,3*a-1],[0,3*a-1,1],[3*a-1,0,1]]) } if(3*a-2<1 && 3*a-2 > 0){ point([3*a-2,1,1]) point([1,3*a-2,1]) point([1,1,3*a-2]) peinture = vert transparence = 0.3 poly([[3*a-2,1,1],[1,3*a-2,1],[1,1,3*a-2]]) } if( a > 1.2 ){ eps = -0.01; } if( a < -0.2 ){ eps = 0.01; } a = a + eps }