###### Beschreibungen und Beispiele zum Raytracer POV-Rayvon Friedrich A. Lohmüller     POV-Ray Beispiele - Die Erstellung von Objekten für POV-Ray
English
Italiano
Français

Home
- POV-Ray Tutorial

- POV-Ray Beispiele
Inhaltsübersicht
- Geometrie
- Architektur
- Haus
- Dach
- Turm mit Zinnen
- Schloss
- Fenster u. Tür
- Treppen
- Pyramide
- Säulen
- Bogen
- Zäune
- Möbel
- Haushalt
- Technik

## Ein Stück Käse

###### Objekte: "box", "sphere", "Rounded Cylinder", "shapes_lo.inc" Methoden: "#declare", "union", "difference", "#while", "#macro" Modell Maßstab: 1 Einheit = 1,00 meter
First we arange some spheres in a rectangular grid:
 #declare Cheese_R_ = 0.30; // width in x #declare Cheese_H_ = 0.14; // width in y #local Max_D = Cheese_H_/4; // distance #local Max_Num_X = int(Cheese_R_/Max_D)-0.5; #local Max_Num_Y = max(1,int(Cheese_H_/Max_D)-0.5); //------------------------------------------------- #local NrX = 0.75; // outer loop x #while (NrX < Max_Num_X) #local NrY = 0.5; // inner loop y #while (NrY < Max_Num_Y) sphere{ <0,0,0>,Max_D/2 translate<(NrX+0.5),(NrY+0.5),0>*Max_D pigment{color rgb<1,0.7,0.3>} finish{phong 1} } // ------- end sphere #local NrY = NrY + 1; // next Nr y #end // --------------- end of inner loop y // end inner loop #declare NrX = NrX + 1; // next Nr x #end // --------------- end of outer loop x
Than we add some random in scale and position. We add before the loop
 #declare Rnd_ = seed( 18926 );
and replace the sphere by this:
 sphere{ <0,0,0>,Max_D/2 scale<1+0.5*(rand(Rnd_)), 1-0.5*(rand(Rnd_)), 1+0.5*(0.5-rand(Rnd_))> translate<(NrX+0.5)+0.85*(0.5-rand(Rnd_)),    (NrY+0.5)+0.85*(0.5-rand(Rnd_)), 0.15*(0.5-rand(Rnd_))> * Max_D pigment{ color rgb<1,0.7,0.3>} } // ------- end sphere
Now we cut a piece of cheese using the macro Round_Cylinder and my macro Segment_of_Object(Object,Angle) :