Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- /*
- Menger Sponge!
- */
- #include "colors.inc"
- camera {
- location <2, 2, -1>
- look_at <0, 1, 2>
- }
- #declare unitbox = box {
- <0, 0, 0>, <1, 1, 1>
- pigment { BrightGold }
- finish { reflection .6 }
- }
- #macro mengersquare(ubox)
- union {
- object { ubox translate 2*x }
- object { ubox translate 2*z }
- object { ubox translate 2*x + 2*z }
- object { ubox }
- }
- #end
- #macro mcube(ubox)
- union {
- object { mengersquare(ubox) }
- object { mengersquare(ubox) rotate 90*z translate 2*x }
- object { mengersquare(ubox) rotate 90*x translate 3*y + z }
- object { mengersquare(ubox) translate y }
- object { mengersquare(ubox) translate 2*y }
- }
- scale 1/3
- #end
- #declare msp1 = union { mcube(unitbox) }
- #declare msp2 = union { mcube(msp1) }
- #declare msp3 = union { mcube(msp2) }
- #declare msp4 = union { mcube(msp3) }
- #declare msp5 = union { mcube(msp4) }
- object { msp5 scale 3 }
- plane {
- y, -1
- pigment { hexagon color Gray05, color Gray10, color Gray15 }
- }
- light_source { <2, 2, 2> color Red }
- light_source { <0, 2, 2> color Blue }
- light_source { <2, 2, 0> color Green }
- light_source { <2, 0, 2> color Magenta }
- light_source { <2, 4, -3> color White }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement