home *** CD-ROM | disk | FTP | other *** search
- // PIGGY BANK
-
- #include "colors.inc"
- #include "textures.inc"
- #include "shapes.inc"
-
- // CAMERA
- camera {
- location <0 0 -7.5>
- direction <0 0 1>
- up <0 1 0>
- right <1.33 0 0>
- look_at <0 0 5>
- }
-
- // LIGHT_SOURCE
- object {
- light_source{< -5 5 -10> color White }
- }
-
- // BACKGROUND PLANES
- object {
- plane { <0 0 1> 12 }
- texture { color White}}
- object {
- plane { <0 1 0 > -2 }
- texture { Jade
- reflection .5}}
-
- // PIGGY OBJECT
- #declare piggy = object {
- union {
- // BODY
- quadric { Ellipsoid
- scale <2 1.5 1.5> }
- // HEAD
- quadric { Ellipsoid
- scale <1 1 1>
- translate <-2.2 0 0> }
- // LEFT CHEEK
- quadric { Ellipsoid
- scale <.5 .5 .5>
- translate <-2.2 -.35 -.65> }
- // RIGHT CHEEK
- quadric { Ellipsoid
- scale <.5 .5 .5>
- translate <-2.2 -.35 .65> }
- // RIGHT EYE
- quadric { Ellipsoid
- scale <.2 .2 .2>
- translate <-2.7 -.2 .75> }
- // LEFT EYE
- quadric { Ellipsoid
- scale <.2 .2 .2>
- translate <-2.7 -.2 -.75> }
- // LEFT FRONT LEG
- intersection {
- intersection {
- quadric {QCone_Y}
- plane {<0 1 0> -1.75}
- plane {<0 1 0> -3.25 inverse} }
- scale < .25 1 .25 >
- rotate < 180 0 0 >
- translate < -.8 -3.5 -.4 > }
- // RIGHT FRONT LEG
- intersection {
- intersection {
- quadric {QCone_Y}
- plane {<0 1 0> -1.75}
- plane {<0 1 0> -3.25 inverse}}
- scale < .25 1 .25 >
- rotate < 180 0 0 >
- translate < -.8 -3.5 .4 >}
- // LEFT REAR LEG
- intersection {
- intersection {
- quadric {QCone_Y}
- plane {<0 1 0> -1.75}
- plane {<0 1 0> -3.5 inverse}}
- scale < .25 1 .25 >
- rotate <180 0 0 >
- translate <.8 -3.5 -.4 >}
- // RIGHT REAR LEG
- intersection {
- intersection {
- quadric {QCone_Y}
- plane {<0 1 0> -1.75}
- plane {<0 1 0> -3.5 inverse}}
- scale <.25 1 .25 >
- rotate <180 0 0 >
- translate <.8 -3.5 .4 >}
- // SNOUT
- intersection {
- intersection {
- quadric {Cylinder_Y}
- plane {<0.0 1.0 0.0> -.5 inverse}
- plane {<0.0 1.0 0.0> 1.25}}
- scale < .375 .9 .375 >
- rotate < 0 0 135 >
- translate < -2.2 0 0 >}
- // LEFT EAR
- difference {
- intersection {
- intersection {
- quadric {QCone_Y}
- plane {<0 1 0> 0}
- plane {<0 1 0> -1 inverse}}
- scale <.25 1 .25>
- translate <-2.2 1.25 -.7>}
- intersection {
- intersection {
- quadric {Cylinder_Y}
- plane {<0 1 0> 0 inverse}
- plane {<0 1 0> -1}}
- scale < .25 1 .25 >
- translate < -2.45 1.25 -.7>}}
- // RIGHT EAR
- difference {
- intersection {
- intersection {
- quadric {QCone_Y}
- plane {<0 1 0> 0}
- plane {<0 1 0> -1 inverse}}
- scale <.25 1 .25>
- translate <-2.2 1.25 .7>}
- intersection {
- intersection {
- quadric {Cylinder_Y}
- plane {<0 1 0> 0 inverse}
- plane {<0 1 0> -1}}
- scale < .25 1 .25 >
- translate < -2.45 1.25 .7>}}
- // TAIL
- intersection {
- quadric { Cylinder_Z
- scale <2 2 2>}
- plane { <0 0 1> 10}
- plane { <0 0 -1> 0}
- quartic {<0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 -0.1666 0 1 0
- 0 0 0 0 0 0 0 .5 0 -1 0 0 0 0 0 >}
- scale <.1 .1 .1>
- rotate <0 -90 45>
- translate <2.15 1 0>}}
- texture {colour red 1 green 0.749020 blue 0.749020
- phong .5}}
-
- // DRAW THE PIG
- object {piggy rotate <0 -30 0> rotate <0 0 0> translate <0 0 0>}
-