Differences
This shows you the differences between two versions of the page.
| Both sides previous revision Previous revision Next revision | Previous revision | ||
| lehrkraefte:blc:math:povray:lektion4 [2017/05/18 14:34] – [Aufgabe 0] Ivo Blöchliger | lehrkraefte:blc:math:povray:lektion4 [2017/05/19 08:06] (current) – Ivo Blöchliger | ||
|---|---|---|---|
| Line 1: | Line 1: | ||
| + | {{: | ||
| + | {{: | ||
| + | |||
| + | ===== Aufgabe 0 ===== | ||
| + | |||
| + | Speichern / Kopieren Sie folgenden Code und fügen den fehlenden Code unten ein (im Moment Kommentare). | ||
| + | |||
| + | <code povray schnecke.pov> | ||
| + | // Kamera | ||
| + | camera { | ||
| + | sky < | ||
| + | right < | ||
| + | location < | ||
| + | look_at <0, 0, 0> // Blickrichtung (erscheint im Bildmittelpunkt) | ||
| + | angle 30 // Öffnungswinkel der Kamera | ||
| + | } | ||
| + | |||
| + | // Lichtquellen | ||
| + | light_source { | ||
| + | < | ||
| + | color rgb < | ||
| + | } | ||
| + | light_source { | ||
| + | < | ||
| + | color rgb < | ||
| + | } | ||
| + | |||
| + | plane {z,0 | ||
| + | pigment | ||
| + | normal { bozo } | ||
| + | finish { reflection 0.9} | ||
| + | } | ||
| + | |||
| + | #declare umdrehung=-4; | ||
| + | #declare ende=2; | ||
| + | #declare sf=1.6; | ||
| + | #declare schritte=50; | ||
| + | | ||
| + | #while (umdrehung< | ||
| + | #declare r = pow(sf, | ||
| + | | ||
| + | // | ||
| + | // Eine Kugel an die Position < | ||
| + | // und danach um umdrehung*360 um die z-Achse drehen | ||
| + | // | ||
| + | // HIER FEHLT IHR CODE | ||
| + | |||
| + | #declare umdrehung = umdrehung + 1/schritte; | ||
| + | #end //while | ||
| + | |||
| + | </ | ||
| + | |||
| + | Das Bild sollte etwa wie folgt aussehen: {{: | ||
| + | |||
| + | ===== Aufgabe 1 ===== | ||
| + | Variieren Sie jetzt den Radius der Kugeln so, dass der Kugelradius proportional zu $r$ ist. | ||
| + | Passen Sie eventuell die Kameraeinstellungen an. Mögliches Resultat: {{: | ||
| + | |||
| + | ===== Aufgabe 2 ===== | ||
| + | Die $z$-Koordinate der Kugeln soll nun ebenfalls linear mit dem Radius variieren. Die $z$-Koordinate soll grösser (höher) für kleine Werte von $r$ sein und für grössere $r$ dann kleiner werden. Mögliches Resultat: | ||
| + | |||
| + | |||
| + | ===== Aufgabe 3 ===== | ||
| + | Die **Modulo**-Operation ' | ||
| + | |||
| + | - Vor der while-Schleife, | ||
| + | - Vor dem Ende der while-Schleife, | ||
| + | - Mittels **if/ | ||
| + | |||
| + | <code povray> | ||
| + | #if (mod(num,2) = 0) | ||
| + | pigment {color rgb x} | ||
| + | #else | ||
| + | pigment {color rgb z} | ||
| + | #end | ||
| + | |||
| + | </ | ||
| + | Variieren Sie nun die Farbe der Kugeln (gibt wohl noch schönere Fabrkombinationen als rot/ | ||
| + | Mögliches Resultat: {{: | ||
| + | |||
| + | Es ist auch möglich ohne if/else/end auszukommen, | ||
| + | <code povray> | ||
| + | pigment { color rgb < | ||
| + | </ | ||
| + | |||
| + | ===== Aufgabe 4 ===== | ||
| + | Ersetzen Sie die Kugeln durch dünne Tori, so dass man ins Schneckenhaus hinein sieht. Z.B. so: | ||
| + | {{: | ||
| + | |||
| + | ===== Aufgabe 5 ===== | ||
| + | Platzieren Sie auf jedem 7. Torus einen Stachel. Z.B. so: {{: | ||
| + | |||
| + | ===== Aufgabe 6 ===== | ||
| + | Der Code von Aufgabe 5 enthält wohl einige Wiederholungen, | ||
| + | Vor der while-Schleife, | ||
| + | <code povray> | ||
| + | #declare teil = union { | ||
| + | // lauter tolle Dinge hier (Kugel, Tori, Tori mit Stacheln etc... | ||
| + | } | ||
| + | </ | ||
| + | |||
| + | Das ' | ||
| + | <code povray> | ||
| + | | ||
| + | scale 0.5*r // oder was auch immer passt. | ||
| + | // veschieben und Drehen... | ||
| + | } | ||
| + | </ | ||
| + | |||
| + | Das ' | ||
| + | |||
| + | {{: | ||
| + | |||
| + | Ein einzelnes ' | ||
| + | |||
| + | |||
| + | ===== Weitere Anregungen ===== | ||
| + | * Platzieren Sie Lichtquellen im Schneckenhaus drin | ||
| + | * Variieren Sie die Farbe kontinuierlich (Farbverlauf, | ||
| + | * Drehen Sie das ' | ||