// ClothRay example: nappe.pov // Christophe Bouffartigue (tofbouf@free.fr) #version unofficial MegaPov 0.7; #include "clothutil.inc" #macro WriteClothFile(nomfile, n1, n2, nlng, ks, ht) #debug "\nWriting new .cth file\n" #fopen file nomfile write #write(file, n1, ",", n2, ",", nlng, ",", ks, ",\n") #local l1 = nlng*(n1-1); #local l2 = nlng*(n2-1); #local st = seed(1234); #local i=0; #while (i, <-39.1, 30, 0>, 4 } #if (clock<.1) #declare Fact = (clock/0.1); #end #if ((clock>=.1) & (clock<=.4)) #declare Fact = 1; #end #if ((clock>.4) & (clock<.6)) #declare Fact = ((0.6-clock)/0.2); #end #if (clock>=.6) #declare Fact = 0; #end #debug concat("\nclock = ", str(clock, 4,4), "\n") #declare Dir1 = <3.0, 0.2, -.1>*Fact; #declare Dir2 = <3.0, 0.2, 0.1>*Fact; #declare Vent = pigment { bozo scale 5 color_map { [.2 color Dir1] [.8 color Dir2] } } //WriteInitialRideau() simcloth { environment Mat friction 0.5 gravity -0.6*y wind { Vent } viscosity 0.7 neighbors 1 internal_collision off damping 0.85 intervals 0.03 iterations 550 input "drapeau.cth" output "drapeau.cth" mesh_output "drapeau_s.msh" smooth_mesh on uv_mesh on } #declare Drapeau = mesh { #include "drapeau_s.msh" uv_mapping texture { pigment { gradient x color_map { [.33 rgb<.1, .2, 1>] [.33 rgb<1, 1, 1>] [.66 rgb<1, 1, 1>] [.66 rgb<1, .2, .1>] } } finish { ambient .3 diffuse .7 } } } camera {location <50, -10, -200> angle 35 look_at 0*x } light_source { 10000*y, color rgb 1.2 rotate -x*30 rotate y*45 } object { Drapeau } union { object { Mat } sphere { <-39.1, 30, 0>, 7 } pigment { rgb .95 } finish { ambient .3 diffuse .7 } } sky_sphere { pigment { gradient y color_map { [0.0 rgb <.8, .9, 1>] [0.2 rgb <.7, .85, 1>] [0.5 rgb <.6, .8, 1>] [0.8 rgb <.5, .7, 1>] } } }