surface showPN(float fpx=1, fpy=1, fpz=1, fnx=1, fny=1, fnz=1, fr=1, fg=1, fb=1, mixf=0.0; vector userDir = vector(1,1,1);) { float r,g,b; vector tmp = vector(fpx*xcomp(P),fpy*ycomp(P),fpz*zcomp(P)); vector Pn = normalize(tmp); vector tmp2 = vector(fnx*xcomp(N),fny*ycomp(N),fnz*zcomp(N)); vector Nn = normalize(tmp2); vector PcrossN = Pn^Nn; r = 0.5*(1.0 + sin(fr*2*3.1415*Pn.userDir)); g = 0.5*(1.0 + sin(fg*2*3.1415*PcrossN.userDir)); b = 0.5*(1.0 + sin(fb*2*3.1415*Pn.Nn)); Ci = Cs*mix(color(r,g,b),color(.5,.5,.5),mixf); }/* showPN() */