// Last edited on 2024-05-01 21:41:20 by stolfi #include "retalho.inc" #include "retalho_pos.inc" #macro surface_generic_control_points() #local Z = array[4][4] #local Z[0][0] = 8.0; #local Z[0][1] = 7.0; #local Z[0][2] = 6.0; #local Z[0][3] = 7.0; #local Z[1][0] = 7.0; #local Z[1][1] = 6.0; #local Z[1][2] = 40.0; #local Z[1][3] = 5.0; #local Z[2][0] = 8.0; #local Z[2][1] = -9.0; #local Z[2][2] = 7.0; #local Z[2][3] = 6.0; #local Z[3][0] = 8.0; #local Z[3][1] = 7.0; #local Z[3][2] = 6.0; #local Z[3][3] = 7.0; #local P = array[4][4] #for (i, 0, 3) #for (j, 0, 3) #local P[i][j] = < 4*i - 6, 4*j - 6, Z[i][j] >; #end #end P #end #macro surface_generic(P, tx) #local rad = 0; object{ retalho(P, rad, tx) } #end #macro surface_generic_norm_vec(P, U, V, tx) #local pos = retalho_pos(P, U, V); #local dir = retalho_normal(P, U, V); #local rad = rad_arrow; #debug concat("!! normal = ( ", str(dir.x,9,6), ", ", str(dir.y,9,6), ", ", str(dir.z,9,6), " )\n") union{ sphere{ pos, 1.5*rad texture{ tx } } object{ garrow(pos, dir, tx) } } #end