#version 3.7; global_settings{ assumed_gamma 1.0 } #declare SCALE=5; #declare TRACTION=15; #declare ZOOM=2*SCALE+1; #declare C1= camera { location -40*z+50*y up y right x*image_width/image_height look_at 0 angle 15 rotate 120*y }; #declare C2= camera { orthographic location 50*y up ZOOM*z right ZOOM*x*image_width/image_height look_at 0 rotate -180*y } #declare C3 = camera { C2 rotate 90*x } #declare C4 = camera { C3 rotate 90*y } camera { grid 2 C2 C1 C3 C4 } light_source { -20*z+10*y-5*x, 1 rotate 30*y } #default{ finish{ emission 0.2 diffuse 0.6 reflection 0.2 ambient 0 }} #declare T=texture { checker texture {pigment { color srgb 0.5 } finish { emission .5 diffuse 0.5 reflection 0 } } texture {pigment { color srgb 0.9 } finish { emission .5 diffuse 0.5 reflection 0 } } }; #declare T2=texture { uv_mapping checker texture {pigment { color blue 0.5 } finish { emission .5 diffuse 0.5 reflection 0 } } texture {pigment { color green 0.9 } finish { emission .5 diffuse 0.5 reflection 0 } } scale 1/12 }; plane { y, 0 texture { T } no_shadow} plane { -z, 300 texture { T } no_shadow} plane { -x, 300 texture { T } no_shadow} #declare A = SCALE*<-1,0,-1>; #declare B = SCALE*<-1,0, 1>; #declare C = SCALE*<1, 0, 1>; #declare D = SCALE*<1, 1/3, -1>; #declare P = (A+B)/2+y/4*TRACTION-x/3*TRACTION; #declare Q = (B+C)/2+y*TRACTION; #declare R = (C+D)/2+y/4*TRACTION+x/3*TRACTION; #declare S = (D+A)/2+y*TRACTION; #macro Point( X ) sphere { 0, 0.25 texture { pigment { color green 1 blue 1 } finish { emission .5 reflection 0 diffuse 0.5 ambient 0 } } translate X } #if (X.y > 0) cylinder { X, , 0.3 texture { pigment { color green 1 } } } #end #end #macro Connect( X, Y ) cylinder { X, Y, 0.05 texture { pigment { color red 1 green abs(X.y-Y.y) } } } #end #macro Curve( X, Y, Z ) spline{ cubic_spline -1, X-(Y-X), 0, X, 1, Z 2, Z-(Y-Z), }; #local Foo = spline{ cubic_spline -1, X-(Y-X), 0, X, 1, Z 2, Z-(Y-Z), }; #local STEP=120; #for(i,0,STEP,1) #local V = Foo(i/STEP); sphere{ V, 0.1 texture { pigment { color blue 1 } } } #end #end Point(A) Point(B) Point(C) Point(D) Connect(A,B) Connect(B,C) Connect(C,D) Connect(D,A) Connect(A,C) Connect(B,D) #declare PS=Curve(A,P,B) #declare QS=Curve(B,Q,C) #declare RS=Curve(C,R,D) #declare SS=Curve(D,S,A) #declare STO=3+frame_number; #macro EvalDelta(P,Q,R,S,i,j) #local V=P(i)-(P(0)*(1-i)+(P(1)*i)); #local W=Q(j)-(Q(0)*(1-j)+(Q(1)*j)); #local X=R(1-i)-(R(0)*i+R(1)*(1-i)); #local Y=S(1-j)-(S(0)*j+S(1)*(1-j)); #local A=((V*(1-j))+(W*i)+(X*j)+(Y*(1-i))); #local Z=(P(0)*(1-i)+P(1)*i)*(1-j)+(i)*(Q(0)*(1-j)+Q(1)*(j))+ (j)*(R(0)*i+R(1)*(1-i))+(1-i)*(S(0)*(j)+(1-j)*S(1)); #local Z = Z/2; #local VALUE=(Z+A*(STO-1)/(STO-2)); #end #macro Cover(P,Q,R,S) rational_bezier_patch { STO,STO #for(i,0,1,1/(STO-1)) #for(j,0,1,1/(STO-1)) EvalDelta(P,Q,R,S,i,j) #end #end texture { T2 } } #for(i,0,1,1/(STO-1)) #for(j,0,1,1/(STO-1)) #local VA= EvalDelta(P,Q,R,S,i,j); sphere { , VA.t/5 texture { pigment { color red 1 } finish { diffuse 0.5 reflection 0 emission 0.5}} } #end #end #end Cover(PS,QS,RS,SS)