with(plots): D2mapD2 := proc(lin1, lin2, plotpoints) # lin1 is a*s+b*t+c, s=0..1, t=0..1, is the height # lin2 is aa*s+bb*t+cc, s=0..1, t=0..1, is the color local plot; plot := seq( seq( polygonplot3d([subs({s=1/plotpoints*i, t=1/plotpoints*j}, [s,t,lin1]), subs({s=1/plotpoints*(i+1), t=1/plotpoints*j}, [s,t,lin1]), subs({s=1/plotpoints*(i+1), t=1/plotpoints*(j+1)}, [s,t,lin1]), subs({s=1/plotpoints*i, t=1/plotpoints*(j+1)}, [s,t,lin1])], color = COLOR(HUE, subs({s=1/plotpoints*i, t=1/plotpoints*j}, lin2)) ), i=0..plotpoints-1), j=0..plotpoints-1); display([plot]); end;