home *** CD-ROM | disk | FTP | other *** search
Text File | 1996-06-30 | 2.9 KB | 124 lines | [TEXT/ttxt] |
- // ----------------------------------------------------------
- // Magic Arabian Lamp, by Eduard Schwan
- // Copyright 1995-1996, POV-Ray Team, All Rights Reserved
- // ----------------------------------------------------------
-
- // ----------------------------------------------------------
- // Lamp
- // ----------------------------------------------------------
-
- // ______
- // \____/
- //
- #declare LampDish_Shape =
- sphere
- {
- 0,1
- clipped_by { box { <-1,-1,-1>, <+1,-0.5,+1> } }
- bounded_by { clipped_by }
- scale <2.0, 1, 1> // make it a long trough
- translate +0.5*y // move it up to touch origin
- }
-
- // _
- // / \
- // -----
- //
- #declare LampPedestal_Shape =
- torus
- {
- 1.0, 0.95 sturm
- clipped_by { cylinder { 0.0*y, -1.1*y, 0.3 } }
- bounded_by { clipped_by }
- scale <2.5, 1, 1> // make it a long pedestal
- translate -0.4*y // move down to touch dish
- }
-
- // _/\_
- //
- #declare LampCover_Shape =
- torus
- {
- 1.0, 1.0 sturm
- clipped_by { cylinder { 0.0*y, -1.1*y, 0.9 } }
- bounded_by { clipped_by }
- scale <2, 1, 1> // make it a long top
- translate +0.98*y // move up to touch dish top
- }
-
- #declare LCH_R1 = 0.4
- #declare LCH_R2 = 0.3
- #declare LCH_R3 = 0.1
-
- // /\
- // \/
- //
- #declare LampCoverHandle_Shape =
- union
- {
- cone { -1*y, LCH_R1, <+0.5,-0.5,0>, LCH_R2 }
- cone { -1*y, LCH_R1, <-0.5,-0.5,0>, LCH_R2 }
- cone { <+0.5,-0.55,0>, LCH_R2, 2*y, LCH_R3 }
- cone { <-0.5,-0.55,0>, LCH_R2, 2*y, LCH_R3 }
- scale <1,1,0.25> // flatten
- scale 0.25 // shrink
- translate 1.1*y
- }
-
- // _-___
- // \___
- //
- #declare LampSpout_Clip_Shape =
- intersection
- {
- union
- {
- cylinder { -1*y, 0*y, 1.0 } // bottom of spout...
- cylinder { -1*z, 1*z, 0.2 translate -0.9*x scale x+2*y+z} // little "bimp" on end
- }
- plane { x, 0 } // only left half of spout
- }
-
- #declare LampSpout_Shape =
- sphere
- {
- 0,1
- clipped_by { object { LampSpout_Clip_Shape } }
- bounded_by { clipped_by }
- scale <2.5, 0.25, 0.25> // make it a long trough
- translate -0.5*x // move it over to stick out the side
- }
-
- //
- // O/-----\
- // \-----/
- #declare LampHandle_Shape =
- union
- {
- intersection // main handle loop
- {
- torus { 0.8, 0.2 sturm } // donut shape handle
- sphere { 0, 1.5 scale <1,0.2,1> } // clip rounded
- rotate 90*x // flip it up
- scale <0.8, 0.2, 1> // squish it flat
- translate +2.2*x // move over to dish edge
- }
- // cylinder { -0.1*z, +0.1*z, 0.2 translate <1.4, 0.2, 0> } // little curl on end
- sphere { 0, 0.2 scale <1,1,-0.2> translate <1.4, 0.2, 0> } // little curl on end
- }
-
-
- // ----------------------------------------------------------
-
- #declare Magic_Lamp =
- union
- {
- object { LampCoverHandle_Shape texture {Lamp_Texture} }
- object { LampCover_Shape texture {Lamp_Texture} }
- object { LampSpout_Shape texture {Lamp_Texture} }
- object { LampDish_Shape texture {Lamp_Texture} }
- object { LampHandle_Shape texture {Lamp_Texture} }
- object { LampPedestal_Shape texture {Lamp_Texture} }
- translate -0.6*y
- }
-