home *** CD-ROM | disk | FTP | other *** search
- /*
- Just an idea.
-
- A lamp on a table, demonstrating falloff of light.
-
- Tests shadowcache: with: 1.9 ms/ray
- without: 2.5 ms/ray
-
- 1993 HWN
- */
-
- #include "shapes.inc"
- #include "colors.inc"
-
- camera {
- location <-130, 200, -200>
- sky <0, 1, 0>
- fov 40
- look_at <0, 150, 0>
- }
-
- #declare Cream = color rgb <0.9, 1.0, 1.0>
-
- #declare Wall_Text = texture {
- diffuse color Cream diffuse 0.8
- ambient color Cream ambient 0.2
- }
-
- #declare wall = object {
- plane { -z, 0 }
- texture {
- Wall_Text
- }
- }
-
-
- #declare Wood_Texture = texture {
- diffuse color Brown diffuse 0.45
- ambient color Brown ambient 0.05
- }
-
- #declare leg = box { <-4, 0, -4>, <4, 100, 4> }
-
- #declare table = composite {
- box { leg translate <-100, 0, 50> }
- box { leg translate <100, 0, 50> }
- box { leg translate <-100, 0, 50> }
- box { leg translate <100, 0, 50> }
- box { <-110, 100, -60>, <110, 110, 60> }
- texture { Wood_Texture }
- }
-
- #declare cap = object {
- quadric { QCone_Y }
- bounded_by { box { <-100, -20, -100>, <100, -40, 100> } }
- clipped_by { bounded_by }
- translate 40*y
- texture {
- ambient color rgb 0.7 * <color CornflowerBlue>
- diffuse color rgb 0.3 * <color CornflowerBlue>
- }
- }
-
- #declare stand = composite {
- cylinder { <0,0,0>, <0,32,0>, 3}
- cylinder { <0,0,0>, <0,3,0>, 15}
- torus { 15,1.5 translate 1.5*y }
- light_source {
- y*45 color rgb 10*<color Yellow>
- radius 4 attenuation 1
- }
- texture {
- ambient color Brass ambient 0.2
- diffuse color Brass diffuse 0.8
- specular color Brass // metallic!
- reflection 0.1
- }
- }
-
- #declare lamp = composite {
- composite {
- stand
- }
- object { cap translate y*30 }
- }
-
- /**********************/
-
- composite { table
- translate z*-60
- }
-
- object { wall }
-
- composite { lamp translate <0, 110, -40> }
- object { light_source { <-200, 200, -200> color rgb 0.2*<1,1,1> } }
-