#include "colors.inc" #include "metals.inc" #include "stones.inc" #include "strings.inc" #include "stars.inc" #include "rand.inc" #include "woods.inc" #include "rad_def.inc" #include "functions.inc" // Mirror #local D = 1.0; #local R = 4.0; #local T = 0.1; // MEDIA #local W = 5; // Beam #declare BEAM_VISIBLE = on; #declare BEAM_RADIUS = 0.05; #declare BEAM_OFFSET_Y = 1 + sin((-pi/2) + clock*pi); #debug concat("Clock:",str(clock,2,2),"\n") #declare BEAM_OFFSET_Z = 0; global_settings { #if (version < 3.7) assumed_gamma 1.0 #end max_trace_level 4 ambient_light 0 /* photons { count 500000 media 100 max_trace_level 3 } */ } camera { location look_at angle 90 } light_source { < 10, 10, -10> color White photons { reflection off refraction off } media_interaction off } plane {y, 0 pigment{checker color White color 0.3*White}} difference { cylinder { -T*x,R*x,D texture {T_Chrome_1A} } sphere { R*x,R pigment {color White} finish {ambient 0 diffuse 0.01 reflection 0.9 conserve_energy} } photons {target collect off refraction off reflection on} translate D*y } #local f = R/2; cylinder { <0,0,-2>, <0,0,2>, 0.05 pigment {color Black} translate f*x } #macro BEAM(YPOS,ZPOS,COLOR) light_source { color COLOR cylinder point_at <0,YPOS,ZPOS> radius 3*BEAM_RADIUS/4 falloff BEAM_RADIUS photons { reflection on refraction on } } #end BEAM(D+0.5, 0, Red) BEAM(D+0.0, 0, Blue) BEAM(D-0.5, 0, Green) #if (BEAM_VISIBLE = on) cylinder { -(T+0.1)*x,W*x,max(D+0.01,BEAM_OFFSET_Y) hollow pigment {color rgbt 1} interior { media { method 3 intervals 1 samples 5 scattering {1, color 10*White extinction 0} } } photons {pass_through} translate D*y // Even with no_reflection the beams will show // in the mirror no_reflection } #end // Interestingly, the reflection of the beam will be // correctly suppressed at locations where the reflected // ray doesn't hit an object, only background color. To // see this comment out the following line. sphere {0,1000 pigment {color Black} hollow}