/********************************************************************* Beispiele zu Flaechen 2. Ordnung Darstellung der Flaeche z=xy mit Schnitten durch zur xy-Ebene paralle Ebenen in verschiedenen Hoehen R. Unger 06/2002 *********************************************************************/ // Hoehe der Schnittebene // Fuer Verwendung mit dem Script do-hcut.pl auskommentieren // #declare wo_denn=-1.5; // global_settings { assumed_gamma 0.8 } #include "colors.inc" #include "textures.inc" #include "skies.inc" #include "metals.inc" #include "stones.inc" #include "glass.inc" camera { location < 10.0, 20.0, 20.0> angle 20 sky <0,0,1> look_at < 0.0, 0.0, 0.0 > } /* // Kamera direkt von oben camera { location < 0.0, 0.0, 30.0> angle 20 sky <0,1,0> look_at < 0.0, 0.0, 0.0 > } */ // Definition der Koordinatensysteme // zuerst die Lanegen der Achsen #declare koords1 = 5; #declare koords2 = 5; #declare koords3 = 4; // Achsendicke #declare koords_rad = 0.05; // und die Richtungen #declare e1=<1,0,0>; #declare e2=<0,1,0>; #declare e3=<0,0,1>; #declare e1_dach=<0.707106781,-0.707106781,0>; #declare e2_dach=<0.707106781, 0.707106781,0>; #declare e3_dach=<0,0,1>; // Koordinatensystem in Ausgangslage // Markierung der positiven Enden mit kleinen Kugeln // in den Farben // x-Achse ... rot // y-Achse ... gruen // z-Achse ... blau #declare coordsystem_xyz=union { cylinder { -1.0*koords1*e1,koords1*e1,koords_rad texture { pigment { color rgb <1,0,1> }} } sphere { koords1*e1 , 2*koords_rad texture { pigment { color rgb <1,0,0> }} } cylinder { -1.0*koords2*e2,koords2*e2,koords_rad texture { pigment { color rgb <1,0,1> }} } sphere { koords2*e2 , 2*koords_rad texture { pigment { color rgb <0,1,0> }} } cylinder { -1.0*koords3*e3,koords3*e3,koords_rad texture { pigment { color rgb <1,0,1> }} } sphere { koords3*e3 , 2*koords_rad texture { pigment { color rgb <0,0,1> }} } } // union // Gedrehtes Koordinatensystem // Markierung der positiven Enden mit kleinen Kugeln // in den Farben // x-Achse ... rot // y-Achse ... gruen // z-Achse ... blau #declare coordsystem_xyz_dach=union { cylinder { -1.0*koords1*e1_dach,koords1*e1_dach,koords_rad texture { pigment { color rgb <1,1,0> }} } sphere { koords1*e1_dach , 2*koords_rad texture { pigment { color rgb <1,0,0> }} } cylinder { -1.0*koords2*e2_dach,koords2*e2_dach,koords_rad texture { pigment { color rgb <1,1,0> }} } sphere { koords2*e2_dach , 2*koords_rad texture { pigment { color rgb <0,1,0> }} } cylinder { -1.0*koords3*e3_dach,koords3*e3_dach,koords_rad texture { pigment { color rgb <1,1,0> }} } sphere { koords3*e3_dach , 2*koords_rad texture { pigment { color rgb <0,0,1> }} } } // union // Hintergrund , Licht usw. background{White} // background{ Black} light_source { < 5.0, 30.0, -5.0> colour White shadowless} light_source { <-10.0, 30.0, 30.0> colour White } light_source { <-30.0, 30.0, 30.0> colour White } light_source { <20.0, -20.0, 20.0> colour White } // Koordinatensystem ins Bild bringen object { coordsystem_xyz } object { coordsystem_xyz_dach } // Definieren unserer Flaeche uber die folgenden Koeffizienten: // // A x2 + B y2 + C z2 + D xy + E xz + F yz + G x + H y + I z + J = 0 #declare qA=0; #declare qB=0; #declare qC=0; #declare qD=1.0; #declare qE=0; #declare qF=0; #declare qG=0; #declare qH=0; #declare qI=-1.0; #declare qJ=0; quadric { , , , qJ // pigment { rgbf <0.5,0.9,1, 0.3> } // A blue-tinted glass pigment { rgbf <0.2,0.3,1, 0.0> } interior { ior 1.0 } // Glass refraction should be 1.3 finish { phong 0.2 phong_size 40 // A highlight reflection 0.1 // Glass reflects a bit } // texture { T_Glass1 } // texture { pigment { color rgb <1,1,0> }} clipped_by { sphere {<0,0,0> 3 }} // clipped_by { box { <-3,-3,-3>,<3,3,3> }} } // Schnitt mit der Ebene parallel zu xy-Ebene // // Trick: wir schneiden, mit der Quadrik einmal innen , // und einmal aussen , dann bleibt nur etwas auf der Flaeche uebrig #declare cut=intersection { quadric { , , , qJ clipped_by { sphere {<0,0,0> 3 }} //clipped_by { box { <-3,-3,-3>,<3,3,3> }} inverse } quadric { , , , qJ clipped_by { sphere {<0,0,0> 3 }} //clipped_by { box { <-3,-3,-3>,<3,3,3> }} } box { <-4,-4,-0.05>,<4,4,0.05> translate <0,0,wo_denn> } } // intersection // Cut ins Bild object { cut texture { pigment { color rgb <1,0,0> }} } // Schnittebene ins Bild box { <-3,-3,-0.05>,<3,3,0.05> translate <0,0,wo_denn> pigment { rgbf <0.8,1.0,0.8, 0.95> } interior { ior 1.0 } finish { phong 0.2 phong_size 40 // A highlight reflection 0.1 // Glass reflects a bit } }