// Shows a Bézier arc. #include "bez.inc" #macro bezarc(Q0, Q1, Q2, Q3, txs, txv) #local rad = 0.06; #local n = 200; union{ sphere{ Q0, 2*rad texture{ txs } } sphere{ Q1, 2*rad texture{ txs } } sphere{ Q2, 2*rad texture{ txs } } sphere{ Q3, 2*rad texture{ txs } } #local i = 0; #while (i <= n) #local T = i/n; #local p = bez_pos(T, Q0, Q1, Q2, Q3); sphere{ p, rad texture{ txs } } #if ((i = 0) | (i = int(n/3)) | (i = int(2*n/3)) | (i = n)) #local vel = bez_diff(T, Q0, Q1, Q2, Q3); #local dir = vnormalize(vel); object{ garrow(p, dir, txv) } #end #local i = i + 1; #end } #end