#declare L_Cuisse=2.7; #declare L_Mollet=2.4; #declare L_Humerus=2.4; #declare L_Radius=2.2; #declare H_Pied=.6; #declare R_Pied=.6; #declare Sqrt_2=.7071067812; #declare Ang1=7; #declare Pi=3.14159265358; #declare R_Membres=.25; #declare R_Doigt=.1; #declare L_Doigt=.7; #declare Coef001 = .4; #declare L_Epaules = 1.6; #declare L_Pas=(L_Mollet*(sin(10*pi/180)+sin(30*pi/180))+L_Cuisse*(sin(30*pi/180)+sin(20*pi/180))*cos (Ang1*pi/180)); #macro Main_Droite1 (J1A1,J1A2,J2A1,J2A2, B1A1,B1A2,B2A1,B2A2, B1A3,B1A4,B2A3,B2A4, R_B_Y, R_B_X, O_M_D, O_M_G, R_M_D, R_M_G) #local Haut=max ( .9*Sqrt_2+L_Cuisse*cos (Ang1*Pi/180)*cos (J1A1*Pi/180)+L_Mollet*cos (J1A2*Pi/180)+H_Pied, .9*Sqrt_2+L_Cuisse*cos (Ang1*Pi/180)*cos (J2A1*Pi/180)+L_Mollet*cos (J2A2*Pi/180)+H_Pied)*y; #local Centre_Coude=<-2-L_Humerus*sin (B1A1*Pi/180)*cos(B1A2*Pi/180), 2.9-L_Humerus*cos (B1A1*Pi/180), -L_Humerus*sin (B1A1*Pi/180)*sin(B1A2*Pi/180)>; #local Coude_Main=<-(L_Radius+L_Doigt)*sin (B1A3*Pi/180)*cos(B1A4*Pi/180), -(L_Radius+L_Doigt)*cos (B1A3*Pi/180), -(L_Radius+L_Doigt)*sin (B1A3*Pi/180)*sin(B1A4*Pi/180)>; #local Vect1=vrotate (Centre_Coude+Coude_Main,<0,R_B_Y,0>); Haut+vrotate (Vect1,) #end // le nouveau droide, blobisé! #macro Droide2 (J1A1,J1A2,J2A1,J2A2, B1A1,B1A2,B2A1,B2A2, B1A3,B1A4,B2A3,B2A4, R_B_Y, R_B_X, O_M_D, O_M_G, R_M_D, R_M_G,Y_Tete) #render concat ("Vous rentrez dans la macro qui dessine le droide humain",chr (13),chr (10)) #ifdef (T_1) #local T1=texture {T_1} #else #local T1=texture {pigment {color Orange}} #warning concat ("texture du corps non definie",chr(13),chr(10)) #warning concat ("Orange defini par defaut",chr(13),chr(10)) #end #ifndef (T_1) #local T_Slip=texture {pigment {color Yellow}} #warning concat ("texture du slip non definie",chr(13),chr(10)) #warning concat ("Jaune defini par defaut",chr(13),chr(10)) #end #ifdef (T_2) #local T2=texture {T_2} #else #local T2=texture {pigment {color Blue}} #warning concat ("texture du T-Shirt non definie",chr(13),chr(10)) #warning concat ("Bleu defini par defaut",chr(13),chr(10)) #end #ifdef (T_3) #local T3=texture {T_3} #else #local T3=texture {pigment {color Gray50}} #warning concat ("texture du pantalon non definie",chr(13),chr(10)) #warning concat ("gris defini par defaut",chr(13),chr(10)) #end #ifndef (Nb_Doigts) #local Nb_Doigts = 5; #warning concat ("Nombre de doigts non precise",chr(13),chr(10)) #warning concat ("5 defini par defaut",chr(13),chr(10)) #end #local Haut=max ( .9*Sqrt_2+L_Cuisse*cos (Ang1*Pi/180)*cos (J1A1*Pi/180)+L_Mollet*cos (J1A2*Pi/180)+H_Pied, .9*Sqrt_2+L_Cuisse*cos (Ang1*Pi/180)*cos (J2A1*Pi/180)+L_Mollet*cos (J2A2*Pi/180)+H_Pied); #local Doigt= union { cylinder {0,,R_Doigt} sphere {,R_Doigt} cylinder {,,R_Doigt} sphere {,R_Doigt} } /* Quelques cas de messages d'avertissements Pour positions dignes du kama sutra... ou d'une fracture du genou! */ #if (J2A2>J2A1) #warning concat ("Jambe gauche non cohéerente",chr (13),chr (10)) #end #if (J1A2>J1A1) #warning concat ("Jambe droite non coherente",chr (13),chr (10)) #end #if (abs (R_B_Y)>45) #warning concat ("Bassin trop tordu",chr (13),chr (10)) #end union { union { // partie en haut de la ceinture blob { threshold .7 cylinder {0,-y,1,1 scale <.8,1,.7> translate <0,-1/2,.05> rotate y*Y_Tete } sphere {0,1,1 //menton 1 scale <.5,.3,.5> rotate -x*15 translate <0,-.8,-.3> rotate y*Y_Tete } sphere {0,1,1 //support de bouche scale <.4,.3,.3> translate <0,-.6,-.3> rotate y*Y_Tete } sphere {0,1,-1 //rabottage de dessus de tête scale 2 translate 2*y rotate y*Y_Tete } sphere {0,1,1 //front scale <.75,.5,.55> translate <0,.45,-.27> rotate y*Y_Tete } sphere {0,1,2 //base scale <1,1.5,1> rotate y*Y_Tete } sphere {0,1,-1 //orbites scale <.3,.15,.34>//<.3,.2,.37> translate <.3,0,-.8> //-.7 rotate y*Y_Tete } sphere {0,1,-1 scale <.3,.15,.34> translate <-.3,0,-.8> rotate y*Y_Tete } #declare Orig = .2; //nez #declare Temoin=Orig; #while (Temoin>-.4) sphere {0,1,1 scale (Temoin-Orig-.1)*.3 translate <0,Temoin,-.6+Temoin/4> rotate y*Y_Tete } #declare Temoin=Temoin-.05; #end sphere {0,1,-1 scale <.7*.3*2,.1,.7*.3*1.3> translate <0,-.47,-.8> rotate y*Y_Tete } sphere {0,1,-1 scale <.7*.3*2,.1,.7*.3*1.3> translate <0,-.52,-.8> rotate y*Y_Tete } scale .9 translate 4.5*y texture {T1} } blob { threshold .2 sphere {0,1,1 //artic epaule gauche scale <.6,.4,.4> translate <-.2,0,0> // rotate z*B2A1 // rotate y*B2A2 translate texture {T2} } sphere {0,1,1 //artic epaule droite scale <.6,.4,.4> translate <.2,0,0> // rotate z*B2A1 // rotate y*B2A2 translate <-L_Epaules,2.9,0> texture {T2} } cylinder {-.5*x,.5*x,1,1 //le dessus scale <1.4,.6,.55>//1,.4 translate <0,2.9,-.05> texture {T2} } sphere {0,1,1 //les trapèzes scale <1,1,.5> translate <.5,2.6,.3> texture {T2} } sphere {0,1,1 scale <1,1,.5> translate <-.5,2.6,.3> texture {T2} } cylinder {0,y,1,1 //les 2 côtés scale <.45,1.5,.8> rotate -z*10 translate <.6,.5,0> texture {T2} } cylinder {0,y,1,1 scale <.45,1.5,.8> rotate z*10 translate <-.6,.5,0> texture {T2} } cylinder {0,y,1,1 //le dos plat scale <.8,1.3,.3> rotate x*4 translate <0,.6,.5> texture {T2} } sphere {0,1,1 //les pectoraux scale <.9,.7,.45> //scale <1,.8,.7> translate <.5,5/6*2.9,-.4> //<.6,5/6*2.9,-.4> texture {T2} } sphere {0,1,1 scale <.9,.7,.45> //scale <1,.8,.7> translate <-.5,5/6*2.9,-.4> //<-.6,5/6*2.9,-.4> texture {T2} } sphere {0,1,1 //le trou du plexus scale <.8,.8,.1> translate <0,1.6,-.55> texture {T2} } sphere {0,1,1 //la ceinture scale <1.3,.3,1.2> texture {T_Slip} } sphere {0,1,1 //fesse gauche scale <.7,.8,.7> translate <-.4,-.4,.2> texture {T_Slip} } sphere {0,1,1 //fesse droite scale <.7,.8,.7> translate <.4,-.4,.2> texture {T_Slip} } sphere {0,1,1 //euh, le devant scale <.5,.4,.9> //<.5,.4,1.2> pas fin //<.5,.4,.9> fin translate <0,-.3,-.1> //<0,-.3,-.3> pas fin //<0,-.3,-.1> fin texture {T_Slip} } sphere {0,1,1 //euh, le devant bis scale <1.2,.6,.8> translate <0,-.3,-.2> texture {T_Slip} } // sphere {0,1,1 #declare Abd1=<.5,.4,.3>; //8 abdominaux (je sais pas combien on en trouve normalement) #declare Z_Abd=.45; sphere {0,1,1 scale Abd1 translate <.35,.1,-Z_Abd> texture {T2} } sphere {0,1,1 scale Abd1 translate <-.35,.1,-Z_Abd> texture {T2} } sphere {0,1,1 scale Abd1 translate <.35,.1+.4,-Z_Abd> texture {T2} } sphere {0,1,1 scale Abd1 translate <-.35,.1+.4,-Z_Abd> texture {T2} } sphere {0,1,1 scale Abd1 translate <.35,.1+.8,-Z_Abd> texture {T2} } sphere {0,1,1 scale Abd1 translate <-.35,.1+.8,-Z_Abd> texture {T2} } sphere {0,1,1 scale Abd1-.05*x translate <.3,.1+1.1,-Z_Abd> texture {T2} } sphere {0,1,1 scale Abd1-.05*x translate <-.3,.1+1.1,-Z_Abd> texture {T2} } } #declare V1=; #declare V2=; #declare Bosse = vlength (vcross(V1,V2)); // #render concat ("Bosse ",str(Bosse,0,3),chr(13),chr (10)) // #render concat ("V1 ",str(vdot(V1,x),0,3)," ",str(vdot(V1,y),0,3)," ",str(vdot(V1,z),0,3)," ",chr(13),chr (10)) // #render concat ("norme (V1) ",str(vlength (V1),0,3),chr(13),chr (10)) // #render concat ("V2 ",str(vdot(V2,x),0,3)," ",str(vdot(V2,y),0,3)," ",str(vdot(V2,z),0,3)," ",chr(13),chr (10)) // #render concat ("norme (V2) ",str(vlength (V2),0,3),chr(13),chr (10)) #declare R_Muscl = 5/3+Bosse*1/3; // 4/3 + Bosse*1/2; //bras gauche blob { threshold 0.2 sphere {0,1,1 //artic epaule gauche scale <.4,.6,.4> translate <0,-.2,0> rotate z*B2A1 rotate y*B2A2 translate texture {T2} } sphere {0,1,1 //biceps haut scale translate -6*L_Humerus/16*y rotate z*B2A1 rotate y*B2A2 translate } sphere {0,1,1 //biceps bas scale translate -9*L_Humerus/16*y rotate z*B2A1 rotate y*B2A2 translate } sphere {-0*y,1,1 //nouveau coude scale <.4,.4,.4> translate <0,-L_Humerus,0> // texture {T2} rotate z*B2A1 rotate y*B2A2 translate } sphere {0,1,1 //avant bras bas scale translate -L_Radius/2*y rotate y*R_M_D rotate z*B2A3 rotate y*B2A4 translate } sphere {0,1,1 //avant bras haut scale translate -L_Radius/3*y rotate y*R_M_D rotate z*B2A3 rotate y*B2A4 translate } sphere {-0*y,1,1 //poignet scale <.3,.6,.3> translate <0,-L_Radius+.2,0> // texture {T2} rotate y*R_M_D rotate z*B2A3 rotate y*B2A4 translate } } #declare V1=; #declare V2=; #declare Bosse = vlength (vcross(V1,V2)); // #render concat ("Bosse ",str(Bosse,0,3),chr(13),chr (10)) // #render concat ("V1 ",str(vdot(V1,x),0,3)," ",str(vdot(V1,y),0,3)," ",str(vdot(V1,z),0,3)," ",chr(13),chr (10)) // #render concat ("norme (V1) ",str(vlength (V1),0,3),chr(13),chr (10)) // #render concat ("V2 ",str(vdot(V2,x),0,3)," ",str(vdot(V2,y),0,3)," ",str(vdot(V2,z),0,3)," ",chr(13),chr (10)) // #render concat ("norme (V2) ",str(vlength (V2),0,3),chr(13),chr (10)) #declare R_Muscl = 5/3 + Bosse*1/3; //4/3 + Bosse*1/2; //bras droit blob { threshold 0.2 sphere {0,1,1 //artic epaule droit scale <.4,.6,.4> translate <0,-.2,0> // texture {T2} rotate -z*B1A1 rotate -y*B1A2 translate <-L_Epaules,2.9,0> texture {T2} } sphere {0,1,1 //biceps haut scale translate -6*L_Humerus/16*y rotate -z*B1A1 rotate -y*B1A2 translate <-L_Epaules,2.9,0> } sphere {0,1,1 //biceps bas scale translate -9*L_Humerus/16*y rotate -z*B1A1 rotate -y*B1A2 translate <-L_Epaules,2.9,0> } sphere {0,1,1 //nouveau coude scale .4 translate -y*L_Humerus rotate -z*B1A1 rotate -y*B1A2 translate <-L_Epaules,2.9,0> } // cylinder {0,-L_Radius*y,R_Membres,1} sphere {0,1,1 //avant bras bas scale translate -L_Radius/2*y rotate y*R_M_G rotate -z*B1A3 rotate -y*B1A4 translate <-L_Epaules-L_Humerus*sin (B1A1*Pi/180)*cos(B1A2*Pi/180), 2.9-L_Humerus*cos (B1A1*Pi/180), -L_Humerus*sin (B1A1*Pi/180)*sin(B1A2*Pi/180)> } sphere {0,1,1 //avant bras haut scale translate -L_Radius/3*y rotate y*R_M_G rotate -z*B1A3 rotate -y*B1A4 translate <-L_Epaules-L_Humerus*sin (B1A1*Pi/180)*cos(B1A2*Pi/180), 2.9-L_Humerus*cos (B1A1*Pi/180), -L_Humerus*sin (B1A1*Pi/180)*sin(B1A2*Pi/180)> } sphere {-0*y,1,1 //poignet scale <.3,.6,.3> translate <0,-L_Radius+.2,0> // texture {T2} rotate y*R_M_G rotate -z*B1A3 rotate -y*B1A4 translate <-L_Epaules-L_Humerus*sin (B1A1*Pi/180)*cos(B1A2*Pi/180), 2.9-L_Humerus*cos (B1A1*Pi/180), -L_Humerus*sin (B1A1*Pi/180)*sin(B1A2*Pi/180)> } } union { #declare Temoin = 0; #while (Temoin < Nb_Doigts) object {Doigt rotate z*O_M_D rotate y*360/Nb_Doigts*Temoin } // #render "Doigt " #declare Temoin = Temoin + 1; #end translate -L_Radius*y rotate y*R_M_G rotate -z*B1A3 rotate -y*B1A4 translate <-L_Epaules-L_Humerus*sin (B1A1*Pi/180)*cos(B1A2*Pi/180), 2.9-L_Humerus*cos (B1A1*Pi/180), -L_Humerus*sin (B1A1*Pi/180)*sin(B1A2*Pi/180)> } union { #declare Temoin = 0; #while (Temoin < Nb_Doigts) object {Doigt rotate z*O_M_G rotate y*360/Nb_Doigts*Temoin } // #render "Doigt " #declare Temoin = Temoin + 1; #end translate -L_Radius*y rotate y*R_M_D rotate z*B2A3 rotate y*B2A4 translate } /* torus {.85,.2 //taille translate <0,.1,0> texture {T2} } */ rotate y*R_B_Y rotate x*R_B_X } union { //partie en dessous de la ceinture /* intersection { //"fesses" sphere {0,1 scale <.9,1,.9> } plane {y,0} } */ /* union { sphere {0,1 //artic jambe droite scale <.4,.4,.4> translate <-.9,0,0> rotate z*45 texture {T2} } cylinder {0,-L_Cuisse*y,R_Membres //cuisse + genou droits rotate -z*7 rotate x*J1A1 translate <-.9*Sqrt_2,-.9*Sqrt_2,0> } sphere {0,.4 translate -L_Cuisse*y rotate -z*Ang1 rotate x*J1A1 translate <-.9*Sqrt_2,-.9*Sqrt_2,0> texture {T2} } } */ blob { threshold .2 sphere {0,1,1 //artic jambe droite scale <.4,.4,.4> translate <-.9,0,0> rotate z*45 texture {T3} } cylinder {0,-L_Cuisse*y,R_Membres,1 //cuisse + genou droits translate -z*R_Membres/2 rotate -z*7 rotate x*J1A1 translate <-.9*Sqrt_2,-.9*Sqrt_2,0> texture {T3} } sphere {0,1,1 scale translate <0,-L_Cuisse*5/8,0> rotate -z*7 rotate x*J1A1 translate <-.9*Sqrt_2,-.9*Sqrt_2,0> texture {T3} } sphere {0,1,1 scale translate <0,-L_Cuisse/4,0> rotate -z*7 rotate x*J1A1 translate <-.9*Sqrt_2,-.9*Sqrt_2,0> texture {T3} } sphere {0,.3,1 translate -L_Cuisse*y rotate -z*Ang1 rotate x*J1A1 translate <-.9*Sqrt_2,-.9*Sqrt_2,0> //texture {T2} texture {T3} } cylinder {0,-L_Mollet*y,R_Membres,1 translate <0,0,-R_Membres/5> rotate x*J1A2 translate <-.9*Sqrt_2-L_Cuisse*sin (Ang1*Pi/180),-.9*Sqrt_2-L_Cuisse*cos (Ang1*Pi/180)*cos (J1A1*Pi/180),-L_Cuisse*cos (Ang1*Pi/180)*sin (J1A1*Pi/180)> texture {T3} } sphere {0,1,1 scale translate <0,-4*L_Mollet/9,R_Membres/2> rotate x*J1A2 translate <-.9*Sqrt_2-L_Cuisse*sin (Ang1*Pi/180),-.9*Sqrt_2-L_Cuisse*cos (Ang1*Pi/180)*cos (J1A1*Pi/180),-L_Cuisse*cos (Ang1*Pi/180)*sin (J1A1*Pi/180)> texture {T3} } /* sphere {<0,-L_Mollet,0>,0.4,1 rotate x*J1A2 translate <-.9*Sqrt_2-L_Cuisse*sin (Ang1*Pi/180),-.9*Sqrt_2-L_Cuisse*cos (Ang1*Pi/180)*cos (J1A1*Pi/180),-L_Cuisse*cos (Ang1*Pi/180)*sin (J1A1*Pi/180)> texture {T2} } */ cylinder {0,-z,1,1 scale <.2,.2,1> scale .8 rotate -y*5 translate <-.9*Sqrt_2-L_Cuisse*sin (Ang1*Pi/180), -.9*Sqrt_2-L_Cuisse*cos (Ang1*Pi/180)*cos (J1A1*Pi/180)-L_Mollet*cos (J1A2*Pi/180)-H_Pied+.12, -L_Cuisse*cos (Ang1*Pi/180)*sin (J1A1*Pi/180)-L_Mollet*sin (J1A2*Pi/180)> //texture {T3} } cylinder {0,-z,1,1 scale <.2,.2,1> scale .8 rotate y*5 translate <-.9*Sqrt_2-L_Cuisse*sin (Ang1*Pi/180), -.9*Sqrt_2-L_Cuisse*cos (Ang1*Pi/180)*cos (J1A1*Pi/180)-L_Mollet*cos (J1A2*Pi/180)-H_Pied+.12, -L_Cuisse*cos (Ang1*Pi/180)*sin (J1A1*Pi/180)-L_Mollet*sin (J1A2*Pi/180)> //texture {T3} } cylinder {0,-z,1,1 scale <.2,.2,1> scale .8 rotate y*12.5 translate <-.9*Sqrt_2-L_Cuisse*sin (Ang1*Pi/180), -.9*Sqrt_2-L_Cuisse*cos (Ang1*Pi/180)*cos (J1A1*Pi/180)-L_Mollet*cos (J1A2*Pi/180)-H_Pied+.12, -L_Cuisse*cos (Ang1*Pi/180)*sin (J1A1*Pi/180)-L_Mollet*sin (J1A2*Pi/180)> //texture {T3} } cylinder {0,-z,1,1 scale <.2,.2,1> scale .8 rotate y*20 translate <-.9*Sqrt_2-L_Cuisse*sin (Ang1*Pi/180), -.9*Sqrt_2-L_Cuisse*cos (Ang1*Pi/180)*cos (J1A1*Pi/180)-L_Mollet*cos (J1A2*Pi/180)-H_Pied+.12, -L_Cuisse*cos (Ang1*Pi/180)*sin (J1A1*Pi/180)-L_Mollet*sin (J1A2*Pi/180)> //texture {T3} } sphere {0,1,1 scale <.3,.4,.8> scale .8 translate <0,.1,-.1> translate <-.9*Sqrt_2-L_Cuisse*sin (Ang1*Pi/180), -.9*Sqrt_2-L_Cuisse*cos (Ang1*Pi/180)*cos (J1A1*Pi/180)-L_Mollet*cos (J1A2*Pi/180)-H_Pied+.12, -L_Cuisse*cos (Ang1*Pi/180)*sin (J1A1*Pi/180)-L_Mollet*sin (J1A2*Pi/180)> } sphere {0,1,1 scale <.3,.3,.3> scale .8 translate .3*y translate <-.9*Sqrt_2-L_Cuisse*sin (Ang1*Pi/180), -.9*Sqrt_2-L_Cuisse*cos (Ang1*Pi/180)*cos (J1A1*Pi/180)-L_Mollet*cos (J1A2*Pi/180)-H_Pied+.12, -L_Cuisse*cos (Ang1*Pi/180)*sin (J1A1*Pi/180)-L_Mollet*sin (J1A2*Pi/180)> //texture {T3} } } /* union { sphere {0,1 //artic jambe gauche scale <.4,.4,.4> translate <.9,0,0> rotate -z*45 texture {T2} } cylinder {0,-L_Cuisse*y,R_Membres //cuisse + genou gauches rotate z*Ang1 rotate x*J2A1 translate <.9*Sqrt_2,-.9*Sqrt_2,0> } sphere {0,.4 translate -L_Cuisse*y rotate z*Ang1 rotate x*J2A1 translate <.9*Sqrt_2,-.9*Sqrt_2,0> texture {T2} }*/ /* } union {*/ //mollet + cheville gauches /* cylinder {0,-L_Mollet*y,R_Membres rotate x*J2A2 translate <.9*Sqrt_2+L_Cuisse*sin (Ang1*Pi/180),-.9*Sqrt_2-L_Cuisse*cos (Ang1*Pi/180)*cos (J2A1*Pi/180),-L_Cuisse*cos (Ang1*Pi/180)*sin (J2A1*Pi/180)> } sphere {<0,-L_Mollet,0>,0.4 rotate x*J2A2 translate <.9*Sqrt_2+L_Cuisse*sin (Ang1*Pi/180),-.9*Sqrt_2-L_Cuisse*cos (Ang1*Pi/180)*cos (J2A1*Pi/180),-L_Cuisse*cos (Ang1*Pi/180)*sin (J2A1*Pi/180)> texture {T2} }*/ blob { threshold .2 sphere {0,1,1 //artic jambe gauche scale <.4,.4,.4> translate <.9,0,0> rotate -z*45 texture {T3} } cylinder {0,-L_Cuisse*y,R_Membres,1 //cuisse + genou gauche translate -z*R_Membres/2 rotate z*7 rotate x*J2A1 translate <.9*Sqrt_2,-.9*Sqrt_2,0> texture {T3} } sphere {0,1,1 scale translate <0,-L_Cuisse*5/8,0> rotate z*7 rotate x*J2A1 translate <.9*Sqrt_2,-.9*Sqrt_2,0> texture {T3} } sphere {0,1,1 scale translate <0,-L_Cuisse/4,0> rotate z*7 rotate x*J2A1 translate <.9*Sqrt_2,-.9*Sqrt_2,0> texture {T3} } sphere {0,.3,1 translate -L_Cuisse*y rotate z*Ang1 rotate x*J2A1 translate <.9*Sqrt_2,-.9*Sqrt_2,0> texture {T3} } //texture {T2} // } //blob { // threshold .2 cylinder {0,-L_Mollet*y,R_Membres,1 translate <0,0,-R_Membres/5> rotate x*J2A2 translate <.9*Sqrt_2+L_Cuisse*sin (Ang1*Pi/180),-.9*Sqrt_2-L_Cuisse*cos (Ang1*Pi/180)*cos (J2A1*Pi/180),-L_Cuisse*cos (Ang1*Pi/180)*sin (J2A1*Pi/180)> texture {T3} } sphere {0,1,1 scale translate <0,-4*L_Mollet/9,R_Membres/2> rotate x*J2A2 translate <.9*Sqrt_2+L_Cuisse*sin (Ang1*Pi/180),-.9*Sqrt_2-L_Cuisse*cos (Ang1*Pi/180)*cos (J2A1*Pi/180),-L_Cuisse*cos (Ang1*Pi/180)*sin (J2A1*Pi/180)> texture {T3} } cylinder {0,-z,1,1 scale <.2,.2,1> scale .8 rotate -y*5 translate <.9*Sqrt_2+L_Cuisse*sin (Ang1*Pi/180), -.9*Sqrt_2-L_Cuisse*cos (Ang1*Pi/180)*cos (J2A1*Pi/180)-L_Mollet*cos (J2A2*Pi/180)-H_Pied+.12, -L_Cuisse*cos (Ang1*Pi/180)*sin (J2A1*Pi/180)-L_Mollet*sin (J2A2*Pi/180)> } cylinder {0,-z,1,1 scale <.2,.2,1> scale .8 rotate y*5 translate <.9*Sqrt_2+L_Cuisse*sin (Ang1*Pi/180), -.9*Sqrt_2-L_Cuisse*cos (Ang1*Pi/180)*cos (J2A1*Pi/180)-L_Mollet*cos (J2A2*Pi/180)-H_Pied+.12, -L_Cuisse*cos (Ang1*Pi/180)*sin (J2A1*Pi/180)-L_Mollet*sin (J2A2*Pi/180)> } cylinder {0,-z,1,1 scale <.2,.2,1> scale .8 rotate -y*12.5 translate <.9*Sqrt_2+L_Cuisse*sin (Ang1*Pi/180), -.9*Sqrt_2-L_Cuisse*cos (Ang1*Pi/180)*cos (J2A1*Pi/180)-L_Mollet*cos (J2A2*Pi/180)-H_Pied+.12, -L_Cuisse*cos (Ang1*Pi/180)*sin (J2A1*Pi/180)-L_Mollet*sin (J2A2*Pi/180)> } cylinder {0,-z,1,1 scale <.2,.2,1> scale .8 rotate -y*20 translate <.9*Sqrt_2+L_Cuisse*sin (Ang1*Pi/180), -.9*Sqrt_2-L_Cuisse*cos (Ang1*Pi/180)*cos (J2A1*Pi/180)-L_Mollet*cos (J2A2*Pi/180)-H_Pied+.12, -L_Cuisse*cos (Ang1*Pi/180)*sin (J2A1*Pi/180)-L_Mollet*sin (J2A2*Pi/180)> } sphere {0,1,1 scale <.3,.4,.8> scale .8 translate <0,.1,-.1> translate <.9*Sqrt_2+L_Cuisse*sin (Ang1*Pi/180), -.9*Sqrt_2-L_Cuisse*cos (Ang1*Pi/180)*cos (J2A1*Pi/180)-L_Mollet*cos (J2A2*Pi/180)-H_Pied+.12, -L_Cuisse*cos (Ang1*Pi/180)*sin (J2A1*Pi/180)-L_Mollet*sin (J2A2*Pi/180)> } sphere {0,1,1 scale <.3,.3,.3> scale .8 translate .3*y translate <.9*Sqrt_2+L_Cuisse*sin (Ang1*Pi/180), -.9*Sqrt_2-L_Cuisse*cos (Ang1*Pi/180)*cos (J2A1*Pi/180)-L_Mollet*cos (J2A2*Pi/180)-H_Pied+.12, -L_Cuisse*cos (Ang1*Pi/180)*sin (J2A1*Pi/180)-L_Mollet*sin (J2A2*Pi/180)> } } /* cone {0,R_Pied/5,-H_Pied*y,R_Pied //pied gauche translate <.9*Sqrt_2+L_Cuisse*sin (Ang1*Pi/180), -.9*Sqrt_2-L_Cuisse*cos (Ang1*Pi/180)*cos (J2A1*Pi/180)-L_Mollet*cos (J2A2*Pi/180), -L_Cuisse*cos (Ang1*Pi/180)*sin (J2A1*Pi/180)-L_Mollet*sin (J2A2*Pi/180)> } */ } texture {T1} translate y*Haut } #render concat ("et Vous en sortez!!",chr (13),chr (10),chr (10)) #end // Le vieux droide // tout en cylindres et spheres #macro Droide1 (J1A1,J1A2,J2A1,J2A2, B1A1,B1A2,B2A1,B2A2, B1A3,B1A4,B2A3,B2A4, R_B_Y, R_B_X, O_M_D, O_M_G, R_M_D, R_M_G) #render concat ("Vous rentrez dans la macro qui dessine le droide type C3PO",chr (13),chr (10)) #ifdef (T_1) #local T1=texture {T_1} #else #local T1=texture {pigment {color Orange}} #warning concat ("texture du corps non definie",chr(13),chr(10)) #end #ifdef (T_2) #local T2=texture {T_2} #else #local T2=texture {pigment {color Blue}} #warning concat ("texture des articulations non definie",chr(13),chr(10)) #end #ifdef (T_3) #local T3=texture {T_3} #else #local T3=texture {pigment {color Gray50}} #warning concat ("texture des cheveux non definie",chr(13),chr(10)) #end #local Haut=max ( .9*Sqrt_2+L_Cuisse*cos (Ang1*Pi/180)*cos (J1A1*Pi/180)+L_Mollet*cos (J1A2*Pi/180)+H_Pied, .9*Sqrt_2+L_Cuisse*cos (Ang1*Pi/180)*cos (J2A1*Pi/180)+L_Mollet*cos (J2A2*Pi/180)+H_Pied); #local Doigt= union { cylinder {0,,R_Doigt} sphere {,R_Doigt} cylinder {,,R_Doigt} sphere {,R_Doigt} } /* Quelques cas de messages d'avertissements Pour positions dignes du kama sutra... ou d'une fracture du genou! */ #if (J2A2>J2A1) #warning concat ("Jambe gauche non cohéerente",chr (13),chr (10)) #end #if (J1A2>J1A1) #warning concat ("Jambe droite non coherente",chr (13),chr (10)) #end #if (abs (R_B_Y)>45) #warning concat ("Bassin trop tordu",chr (13),chr (10)) #end union { union { // partie en haut de la ceinture union { //tete sphere {0,1 //la sphere de base scale <.6,1.2,.6> translate 4.5*y } sphere {0,.1 //un oeil translate <0,.2+4.5,-.55> rotate y*25 texture {pigment {color White}} } sphere {0,.1 //et l'autre translate <0,.2+4.5,-.55> rotate -y*25 texture {pigment {color White}} } #ifndef (Bass_Res) #ifndef (Pas_de_Cheveux) #local X0=-.6; //les trucs qui font penser aux cheveux #while (X0<=.6) #local Z0=-.4; #while (Z0<=.6) #if (sqrt (X0*X0+Z0*Z0)<.6) cone {,.03,,.01 texture {T3} } #end #local Z0=Z0+.04; #end #local X0=X0+.04; #end #end #end } torus {.4,.2 //cou translate 3.6*y texture {T2} } sphere {0,1 //epaules scale <2,.6,1.1> translate 2.9*y } intersection { //torax sphere {0,1 scale <1.4,3.4,1> //avant 3.1 en y } plane {y,0} translate 2.9*y texture {T1} #ifndef (Bass_Res) #ifndef (Pas_de_Logo) texture { T1 pigment {image_map {gif "Supelec.gif" map_type 0 interpolate 2 once} translate <-.5,-.5,0> scale <2,1.5,1> translate 1.5*y } } #end #end } sphere {0,1 //artic epaule gauche scale <.4,.4,.4> translate <2,2.9,0> texture {T2} } sphere {0,1 //artic epaule droite scale <.4,.4,.4> translate <-2,2.9,0> texture {T2} } union { cylinder {0,-L_Humerus*y,R_Membres} //Humerus Droit sphere {-L_Humerus*y,.4 texture {T2} } rotate -z*B1A1 rotate -y*B1A2 translate <-2,2.9,0> } union{ cylinder {0,-L_Humerus*y,R_Membres} //Humerus Gauche sphere {-L_Humerus*y,.4 texture {T2} } rotate z*B2A1 rotate y*B2A2 translate <2,2.9,0> } union { //Radius gauche + poignet + main cylinder {0,-L_Radius*y,R_Membres} sphere {-L_Radius*y,.4 texture {T2} } union { object {Doigt rotate z*O_M_G } object {Doigt rotate z*O_M_G rotate y*90 } object {Doigt rotate z*O_M_G rotate y*180 } object {Doigt rotate z*O_M_G rotate y*270 } translate -L_Radius*y } rotate y*R_M_G rotate -z*B1A3 rotate -y*B1A4 translate <-2-L_Humerus*sin (B1A1*Pi/180)*cos(B1A2*Pi/180), 2.9-L_Humerus*cos (B1A1*Pi/180), -L_Humerus*sin (B1A1*Pi/180)*sin(B1A2*Pi/180)> } union { //Radius droit + poignet + main cylinder {0,-L_Radius*y,R_Membres} sphere {-L_Radius*y,.4 texture {T2} } union { object {Doigt rotate z*O_M_D } object {Doigt rotate z*O_M_D rotate y*120 } object {Doigt rotate z*O_M_D rotate y*180 } object {Doigt rotate z*O_M_D rotate y*270 } translate -L_Radius*y } rotate y*R_M_D rotate z*B2A3 rotate y*B2A4 translate <2+L_Humerus*sin (B2A1*Pi/180)*cos(B2A2*Pi/180), 2.9-L_Humerus*cos (B2A1*Pi/180), -L_Humerus*sin (B2A1*Pi/180)*sin(B2A2*Pi/180)> } torus {.75,.3 //taille translate <0,.1,0> texture {T2} } rotate y*R_B_Y rotate x*R_B_X } union { //partie en dessous de la ceinture intersection { //"fesses" sphere {0,1 scale <.9,1,.9> } plane {y,0} } sphere {0,1 //artic jambe droite scale <.4,.4,.4> translate <-.9,0,0> rotate z*45 texture {T2} } sphere {0,1 //artic jambe droite scale <.4,.4,.4> translate <.9,0,0> rotate -z*45 texture {T2} } union { //cuisse + genou droits cylinder {0,-L_Cuisse*y,R_Membres rotate -z*7 rotate x*J1A1 translate <-.9*Sqrt_2,-.9*Sqrt_2,0> } sphere {0,.4 translate -L_Cuisse*y rotate -z*Ang1 rotate x*J1A1 translate <-.9*Sqrt_2,-.9*Sqrt_2,0> texture {T2} } } union { //cuisse + genou gauches cylinder {0,-L_Cuisse*y,R_Membres rotate z*Ang1 rotate x*J2A1 translate <.9*Sqrt_2,-.9*Sqrt_2,0> } sphere {0,.4 translate -L_Cuisse*y rotate z*Ang1 rotate x*J2A1 translate <.9*Sqrt_2,-.9*Sqrt_2,0> texture {T2} } } union { //mollet + cheville droits cylinder {0,-L_Mollet*y,R_Membres rotate x*J1A2 translate <-.9*Sqrt_2-L_Cuisse*sin (Ang1*Pi/180),-.9*Sqrt_2-L_Cuisse*cos (Ang1*Pi/180)*cos (J1A1*Pi/180),-L_Cuisse*cos (Ang1*Pi/180)*sin (J1A1*Pi/180)> } sphere {<0,-L_Mollet,0>,0.4 rotate x*J1A2 translate <-.9*Sqrt_2-L_Cuisse*sin (Ang1*Pi/180),-.9*Sqrt_2-L_Cuisse*cos (Ang1*Pi/180)*cos (J1A1*Pi/180),-L_Cuisse*cos (Ang1*Pi/180)*sin (J1A1*Pi/180)> texture {T2} } } union { //mollet + cheville gauches cylinder {0,-L_Mollet*y,R_Membres rotate x*J2A2 translate <.9*Sqrt_2+L_Cuisse*sin (Ang1*Pi/180),-.9*Sqrt_2-L_Cuisse*cos (Ang1*Pi/180)*cos (J2A1*Pi/180),-L_Cuisse*cos (Ang1*Pi/180)*sin (J2A1*Pi/180)> } sphere {<0,-L_Mollet,0>,0.4 rotate x*J2A2 translate <.9*Sqrt_2+L_Cuisse*sin (Ang1*Pi/180),-.9*Sqrt_2-L_Cuisse*cos (Ang1*Pi/180)*cos (J2A1*Pi/180),-L_Cuisse*cos (Ang1*Pi/180)*sin (J2A1*Pi/180)> texture {T2} } } cone {0,R_Pied/5,-H_Pied*y,R_Pied //pied droit translate <-.9*Sqrt_2-L_Cuisse*sin (Ang1*Pi/180), -.9*Sqrt_2-L_Cuisse*cos (Ang1*Pi/180)*cos (J1A1*Pi/180)-L_Mollet*cos (J1A2*Pi/180), -L_Cuisse*cos (Ang1*Pi/180)*sin (J1A1*Pi/180)-L_Mollet*sin (J1A2*Pi/180)> } cone {0,R_Pied/5,-H_Pied*y,R_Pied //pied gauche translate <.9*Sqrt_2+L_Cuisse*sin (Ang1*Pi/180), -.9*Sqrt_2-L_Cuisse*cos (Ang1*Pi/180)*cos (J2A1*Pi/180)-L_Mollet*cos (J2A2*Pi/180), -L_Cuisse*cos (Ang1*Pi/180)*sin (J2A1*Pi/180)-L_Mollet*sin (J2A2*Pi/180)> } } texture {T1} translate y*Haut } #render concat ("et Vous en sortez!!",chr (13),chr (10),chr (10)) #end