home *** CD-ROM | disk | FTP | other *** search
- /*
- paperclip, mimicked from the Cook/Porter/Carpenter article if you
- remove all the "sturm" keywords, and use the "zoom" camera, it makes
- a great demo of the quartics numerical inaccuracies.
-
- It looks pretty good at 640x400x50 iterations, but you could do with
- less rays per pixel, especially if you use a higher resolution
-
- HWN
- */
-
-
- #include "colors.inc"
- #include "shapes.inc"
-
- #declare final = camera {
- location <-6, 7, -20>
- look_at <0, 0, 0>
- sky <0, 1, 0>
- fov 20
- aspect 1.0
- }
-
- #declare zoom = camera {
- location <-3, 6, -10>
- look_at <0, 1.5, 0>
- sky <0, 1, 0>
- fov 18
- }
-
- camera { final }
-
- options {
- background y color Grey20
- iterations 16
- antialias 1.0
- tolerance 0.007
- }
-
- #declare Wood_Finish = texture {
- reflection color Grey80
- reflect_angle 3
- diffuse color Brown diffuse 0.45
- ambient color Brown ambient 0.05
- }
-
- #declare table = object {
- polygon { <-20, 0, 7>, <7, 0, 7>, <7, 0, -12>, <-20, 0, -12> }
- texture { Wood_Finish }
- }
-
- #declare paperclip = object {
- union {
- intersection {
- torus { 0.3, 0.05 sturm rotate <90,0,0> }
- plane { <0, 1, 0>, 0 }
- }
- cylinder { <-0.3, 0, 0>, <-0.3, 2, 0>, 0.05 }
- /* intersection {
- Y_Disk
- scale <0.05, 2, 0.05>
- translate <-0.3, 0, 0>
- }
- */
- cylinder { <0.3, 0, 0>, <0.3, 1.25, 0>, 0.05}
- /* intersection { Y_Disk
- scale <0.05, 1.25, 0.05>
- translate <0.3, 0, 0>
- }*/
- intersection {
- torus { 0.25, 0.05 sturm rotate <90,0,0> }
- plane { <0, -1, 0>, 0 }
- translate <-0.05, 2, 0>
- }
- cylinder { <0.2, 0.5, 0>, <0.2, 2.0,0>, 0.05 }
- /* intersection {
- Y_Disk
- scale <0.05, 1.5, 0.05>
- translate <0.2, 0.5, 0>
- }
- */ intersection {
- torus { 0.2, 0.05 sturm rotate <90,0,0> }
- plane { <0, 1, 0>, 0 }
- translate <0, 0.5, 0>
- }
- cylinder { <-0.2, 0.5, 0>, <-0.2, 1.25,0>, 0.05 }
- /* intersection {
- Y_Disk
- scale <0.05, 0.75, 0.05>
- translate <-0.2, 0.5, 0>
- }*/
- }
-
- texture {
- specular color rgb 0.5 * <color White>
- roughness 0.15
- diffuse color White diffuse 0.35
- ambient color White ambient 0.07
- }
-
- bounded_by { box { <-0.55, -0.35, 0.1>, <0.55, 2.55, -0.1> } }
- translate <0, 0.35, 0>
- }
-
- object { paperclip }
-
- object { table }
-
- object {
- light_source {
- <-6, 13, -13>
- color Gray40
- radius 2
- }
- }
-
- object {
- light_source {
- <0, 10, 40>
- color White
- radius 3
- }
- }
-