//light sabre scene with media statement //by Kurt Bangert //http://www.travelnotes.de/rays // //the grip is the type that //Luke Skywalker used. Normally, only a //green blade would be authentical, but for the scene, //I used a pink blade also. // //If you want to learn //everything about light sabres and why they are //spelled sabre and not saber, please try: //http://www.synicon.com.au/sw/ls/sabres.htm#index //Robert Brown is a real expert in light sabres. //foreword global_settings { max_trace_level 50 } #include "colors.inc" #include "textures.inc" #include "metals.inc" #declare r1=seed(1) //camera and light camera {location <2,-12,-60> look_at <3,-10,0>} background{Black} light_source { <20, -15, -20> color rgb <1,1,1> } //declare two simple textures for the grip #declare alu=texture { pigment { P_Silver4 } finish { F_MetalC } normal{bumps 0.04 scale <1,.1,1>}} #declare dark=texture {pigment{Gray40} finish{F_MetalB}} //media statements for the blade #declare outer_blue_light= media { emission <.01,.01,.05>} #declare inner_blue_light= media { emission <0,0,.9>} #declare outer_pink_light= media { emission <.14,.01,.14> } #declare inner_pink_light= media { emission <.9,.3,.9>} #declare outer_green_light= media { emission <.01,.08,.01>} #declare inner_green_light= media { emission <.14,.9,.14>} //the blade of the light sabre - a cone with two ellipsoids #declare blade= merge{ object{ cone {<0,0,0> 1 <0,50,0> .7 hollow} no_shadow pigment{Clear} } object{sphere {<0,0,0> .7 no_shadow scale y*3 translate y*50 hollow }pigment {Clear}} object{sphere {<0,0,0> 1 no_shadow scale y*3 hollow }pigment {Clear}} } //CSG statements for the grip #declare lg=9.5 #declare grip= union{ object{torus {1.25, 0.1}translate -y*0 texture{alu}} object{cylinder{<0,0,0><0,lg-.3,0> 1.35} texture {alu}} object{cylinder{<0,lg-.3,0><0,lg,0> 1.35} texture {dark}} object{cylinder{<0,2.7,0><0,5.3,0> 1.45} texture {alu}} object{cylinder{<0,5.4,0><0,9,0> 1.45} texture {alu}} #declare i = 0 #while (i < 9) object{cone{<0,0,0>1.35 <0,.15,0> 1.2 } texture {dark} translate <0,lg+0.5*i,0>} object{cone{<0,.15,0>1.2 <0,.3,0> 1.35 } texture {dark} translate <0,lg+0.5*i,0>} object{cylinder{<0,.3,0><0,.5,0> 1.35} texture {alu} translate <0,lg+0.5*i,0>} #declare i = i+1 #end object{cone{<0,0,0>1.35 <0,.25,0> 1. } texture {dark} translate <0,lg+0.5*i,0>} object{cylinder{<0,14,0><0,14.8,0> .6} texture {dark} } object{cone{<0,14.8,0>.6<0,14.9,0> .8} texture {dark} } object{cylinder{<0,14.9><0,15.1,0> .8}texture {dark} } object{cylinder{<0,15.1,0><0,15.3,0> 1.35} texture {alu} } object{cylinder{<0,15.2,0><0,15.9,0> 1.15} texture{T_Brass_4B}} object{cylinder{<0,15.9,0><0,16.4,0> .6} texture{T_Brass_4B} } object{cylinder{<0,16.4,0><0,16.5,0> .55} texture{T_Brass_4B} } object{cylinder{<0,16.5,0><0,16.9,0> .6} texture{T_Brass_4B} } object{cylinder{<0,16.9,0><0,17.3,0> .9} texture{T_Brass_4B} } object{cylinder{<0,17.3,0><0,18.3,0> 1.3} texture {alu} } object{cylinder{<0,18.3,0><0,18.8,0> 1.6} texture {alu} } object{cylinder{<0,18.8,0><0,18.9,0> 1.8} texture {alu} } object{box{<-.4,0,><0.4,3.8,-.8>} translate <0,5.3 ,-1.4> rotate y*90 texture {alu}} #declare radz=1.7 #declare trapez= difference{ object{box{<-.4,0,0><0.4,1,-radz>}} object{box{<-.5,0,0><0.5,1,-radz-1>} rotate -x*20 translate y*1.4} object{box{<-.5,0,0><0.5,1,-radz-1>} rotate x*20 translate -y*1.4} object{box{<-.5,-.1,0><0.5,1.,-radz-1>} rotate y*15 translate x*1.2} object{box{<-.5,-.1,0><0.5,1.,-radz-1>} rotate -y*15 translate -x*1.2} } #declare i = 0 #while (i < 6) object{trapez texture {alu} translate<0,.7,0> rotate y*(i*60+10)} #declare i = i+1 #end }//end union grip //two sabres of different color #declare pink_sabre= union { light_source { <0, 5, 0> color rgb <.5,0,.5> } object {blade no_shadow interior {media{inner_pink_light }}} object {blade no_shadow scale <3,.97,3> translate <0,2.5,0 > interior {media{outer_pink_light }}} object {grip translate -y*18.9} } #declare green_sabre= union { light_source { <0, 5, 0> color rgb <0,.5,0> } object {blade interior {media{inner_green_light }}} object {blade scale <3,.97,3> translate <0,2.5,0 > interior {media{outer_green_light }}} object {grip translate -y*18.9} } #declare blue_sabre= union { light_source { <0, 5, 0> color rgb <0,0,.5> } object {blade interior {media{inner_blue_light }}} object {blade scale <3,.97,3> translate <0,2.5,0 > interior {media{outer_blue_light }}} object {grip translate -y*18.9} } //two sabres in the scene object{pink_sabre scale 0.5 rotate z*30 translate <0,-15,-15> } //object{blue_sabre scale 0.5 rotate z*0 translate <0,-15,-15> } object{green_sabre scale 0.5 rotate -z*30 translate <-7,-15,-15> } //constructing a room, just to get a background for the sabres #declare roombase=difference { object{sphere{<0,0,0> 100 hollow pigment{White*.3}}} object{cylinder{<0,0,0><0,0,150> 50 pigment{Clear}}} } #declare segment1=difference{ object{torus{8,.7} scale <2,1,2> pigment {White*.35}} object{box{<-100,-2,-100><100,2,0>} pigment {Clear}} object{box{<-100,-2,-100><100,2,0>} rotate y*135 pigment {Clear}} } #declare segment2=difference{ object{torus{14.,.7} scale <2,1,2> pigment {White*.35}} object{box{<-100,-2,-100><100,2,0>} pigment {Clear}} object{box{<-100,-2,-100><100,2,0>} rotate y*135 pigment {Clear}} } #declare segment3=difference{ object{torus{20.,.7} scale <2,1,2> pigment {White*.35}} object{box{<-100,-2,-100><100,2,0>} pigment {Clear}} object{box{<-100,-2,-100><100,2,0>} rotate y*135 pigment {Clear}} } //declare a window //if you know "Return of the Jedi", you will see some similarity #declare window=union{ //outer torus and window pane object{torus{25,.7} scale <2,1,2>} object{disc {<0, 0, 0> y,50} pigment{color rgbf <1,1,1,0.95>} finish {diffuse 0.05 reflection 0.4}} //the spokes #declare Count = 0 #while (Count < 8) object{cylinder{<-25,0,0><-3,0,0> .7} scale<2,0,2> pigment {White*.35} rotate y*45*Count} #declare Count = Count+1 #end //the rest of the window object{torus{3.,.7} scale <2,1,2> pigment {White*.35}} #declare angle1=-45 object{segment1 rotate y*(angle1)} object{segment1 rotate y*(angle1-90)} object{segment1 rotate y*(angle1-180)} object{segment1 rotate y*(angle1-270)} #declare angle1=0 object{segment2 rotate y*(angle1)} object{segment2 rotate y*(angle1-90)} object{segment2 rotate y*(angle1-180)} object{segment2 rotate y*(angle1-270)} #declare angle1=-45 object{segment3 rotate y*(angle1)} object{segment3 rotate y*(angle1-90)} object{segment3 rotate y*(angle1-180)} object{segment3 rotate y*(angle1-270)} } //end union window //declare a room declare room=union{ object{roombase} object{window rotate -x*90 translate z*86 pigment {White*.35}} } object {room rotate y*40} //floor object{box{<-100,-31,-100><100,-30,100>} pigment {White*.5}} //declare some stars #declare Count = 0; #while (Count < 500) object{sphere{<200*rand(r1),200*rand(r1)-50,200> .3*rand(r1)} pigment {White} finish {Luminous} } #declare Count = Count+1; #end