//Description: // A Lamp of my own design // Utilizes a hyperbolic mirror // sweegy //Author: Ben Scheele //Date: 12-14-2002 (1-9-03) #declare rad = 1; global_settings { #if(rad = true) radiosity { pretrace_start 0.08 pretrace_end 0.01 count 80 nearest_count 6 error_bound 1.7 recursion_limit 1 low_error_factor 0.7 gray_threshold 0.0 minimum_reuse 0.015 brightness .85 //--- higher value makes everything look brighter, especially the light and mirror adc_bailout 0.01/2 } //ambient_light off #end //photons{ spacing .01 } } camera{ ultra_wide_angle location <0,15,-40> //<0,80,-80> up y right x look_at <0,-3,-3> angle //75 40 } //light_source{ <-50,500,50> rgb .3 } background{ rgb .5 } //----------------Inner Hyperbolic Reflecting Mirror ----------------- #declare w = 6; #declare h = 8; #declare r_top = 1.5; #declare r_bot = r_top+w; #declare Step = 1; #declare T = 1; #declare EndT = 15; // Number of flat sections to approximate the hyperbolic surface // more = smoother, but with less you get cool // patterns in the light and shadow #declare half = union{ #while(T < EndT + Step) cone{ <0,0,0>, r_bot*(1-T/EndT), <0,h*T/EndT,0>, r_top } #declare T = T + Step; #end pigment{ rgb <1,.85,1> } finish{ ambient 0 diffuse .6 phong .7 reflection {.05 .15 falloff .5 metallic .2 } metallic .5 specular .25 roughness .01 brilliance .05 conserve_energy } translate -h*y } #declare hyp_mirror = union{ object{ half } object{ half rotate 180*x } photons{ reflection on } } //--------------------------------------------- //--------- Fluorescent Light --------------------- #declare bright = .75; // a dimmer swith 0 = light off, 1 = all the way on #declare fl_light = union{ #declare r_o = .9; #declare r_i = .7; #declare r_maj = 4; difference{ torus{ r_maj, r_o hollow} torus{ r_maj, r_i hollow} pigment{ rgbf <.9,.8,.6,.2> transmit .8} finish { specular 0.4 roughness 0.005 brilliance .002 phong .8 diffuse .9 ambient .6 reflection { 0.125, 0.25 falloff .5 metallic .8 fresnel on} //conserve_energy } interior { ior 1.45 caustics 1 fade_distance 3 fade_power 3 media{ scattering{ 1, rgb <.3,.4,.5> } emission rgb <1,.85,.75> absorption rgb <.4,.3,.4> } } photons{ target reflection on refraction on collect } } #declare X = 0; #declare EndX = 15; //The number of lights contained by the flourescent light ring. // Higher # means better approx., but slower #declare pt_light = light_source{ , rgb .5*5/EndX*bright photons{ reflection on refraction on }} #declare ring_light = union{ #while(X < EndX) object{ pt_light rotate X/EndX*360*y } #declare X = X + 1; #end } object{ ring_light } } //--------------------------------------------------- //--------- Struts ------------------ #declare struts = union{ #declare b = .175; #declare R = 0; #while(R < 3) union{ cylinder{ r_top*.9*x, (r_maj-r_o)*x, .2 } difference{ cylinder{ -b*z, b*z, r_o+.2 } cylinder{ -b*1.1*z, b*1.1*z, r_o } translate r_maj*x } rotate R*120*y } #declare R = R + 1; #end texture{ pigment{ rgb <.8,.8,.75>*.5 } finish{ ambient .2 diffuse .8 phong 1 reflection .2 metallic .3 specular .3 brilliance .05 roughness .005 } normal{ bumps .04 scale .15 } } photons{ target reflection on } } //------------------------------------ //-------------------- Lamp Shade ------------------------ #declare rot = 0;//-75; //goes from 0 when down all the way, to -90 when all the way up. #declare lamp_shade = union{ #declare ht = 2; #declare wid = 4; #declare th = .2; #declare trans = .6; #declare fd = .3; #declare panel = box{ <-wid,-ht,-th>*.5, *.5 finish{ ambient .4*0 diffuse .8 phong .4 reflection {.0025 .0035 fresnel on } metallic .2 brilliance .4 } interior { media{ scattering{ 1, rgb <.6,.4,.1> } emission rgb <.2,.2,.2> absorption rgb <.1,.3,.2> } ior 1.5 caustics .75 fade_distance 1 fade_power 3 } hollow photons{ target reflection on refraction on} } #declare s8 = seed(24265); #macro panel_row(ht1,rotation,ht2) union{ #declare Step = 1; #declare T = 0; #declare EndT = 16; #while(T < EndT + Step) object{ panel pigment{ hexagon pigment{ rgbf .4+x+t*fd transmit trans } pigment{ rgbf .4+y+t*fd transmit trans } pigment{ rgbf .4+z+t*fd transmit trans } turbulence .2 rotate 90*x rotate 3*T*z translate 300*rand(s8) scale 1 } // ------- This is the section that needs some work, // the transformations for the lamp shade to get it to move correctly. translate ht1/2*y rotate rotation*x //amount rotated depends on how far down the shade is translate ht2/2*y translate <0,h,r_bot+2.8> rotate 360*T/EndT*y } #declare T = T + Step; #end } #end #declare Step2 = 1; #declare T2 = 0; #declare EndT2 = 2.5; #while(T2 < EndT2 + Step2) object{ panel_row(-ht,-rot,ht) translate -T2*2*ht*cos(rot*pi/180)*y } object{ panel_row(ht,rot,-ht) translate -(T2*2+1)*ht*cos(rot*pi/180)*y-2*sin(rot/90)*y } #declare T2 = T2 + Step2; #end } //------------------------------------ //----------------- Setting ------------ #declare setting = difference{ box{ <-1,-1,-2>, <2,1,1> } box{ <-1,-1,-1.75>, <1.75,.7,1> translate <.2,.2,-.2> } cylinder{0, 4*y, .8 } //skylight cuts a hole in the box // box{ <-.1,0,-.14>, <.099,1,.08> scale 8 rotate -90*z } //window scale 30 pigment{ rgb .7 } finish{ ambient .4*0 diffuse .6 phong .1 phong_size 1 metallic .1 specular .1*0 roughness .2 } //----------------------------------------- } union{ object{ hyp_mirror } object{ fl_light } object{ struts } object{ lamp_shade } } object{ setting rotate 45*y translate <0,9.2,10> }