# node.awk # Beispiel der Erzeugung eines VRML files ueber # mathematische definierte Flaechen # Aufruf: # # awk -f node.awk > sowieso.wrl # benutzt werden Zylinderkoordinaten, hier gewuenschte Funktion einsetzen function z(r,phi) { return r+phi; } function print_points(r,phi) { printf(" %f %f %f\n",r*cos(phi),r*sin(phi),z(r,phi)); } BEGIN { PI=3.141 r_max=40; r_inc=1; phi_max=2*PI phi_inc=2*PI/40.0; print "#VRML V2.0 utf8" print "" print "Transform " print " {" print " rotation -1 0 0 1.57" print " children " print " [" print " Shape " print " {" print " appearance Appearance " print " {" print " material Material " print " {" print " }" print " }" print " geometry DEF INDEXFACESET IndexedFaceSet " print " {" print " coord Coordinate " print " {" print " point " print " [" for (r=0;r