Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- // *************************************************************
- // * Flynn_Glass-Balls (c) 2017 by Flynn *
- // *************************************************************
- #version 3.7;
- #include "glass.inc"
- #include "colors.inc"
- global_settings
- {
- adc_bailout 0.003922
- ambient_light <1.0,1.0,1.0>
- assumed_gamma 2.2
- irid_wavelength <0.247059,0.176471,0.137255>
- max_trace_level 25
- number_of_waves 15
- }
- // *** Camera ***
- camera {
- //location <0, 10.5,-100>
- //location <-20, 120,-90>
- //location <-40, 50,-160>
- location <-60, 5,-170>
- direction <0, 0, 1>
- up <0, 1, 0>
- right <4/3, 0, 0>
- look_at <0, 75, 0>
- }
- // *** Light-Sources ***
- light_source {<30, 120, 0> colour <1.5,1.5,1.5>
- fade_distance 90
- fade_power 2
- }
- // *** Background ***
- sky_sphere {
- pigment {
- gradient y
- color_map {
- [0.0 Gray50 ]
- [1.0 Gray15 ]
- }
- }
- }
- // *** Texture for the Brick-Room ***
- #declare Brick =
- texture {
- pigment { brick Gray80, rgb<0.65, 0.3, 0.25> brick_size <3,1,2> mortar 0.15 }
- normal { brick -10 brick_size <3,1,2> mortar 0.175 ramp_wave}
- finish {
- ambient 0.0
- diffuse 0.8
- }
- scale 6
- }
- // *** Geometry ***
- // ** The Brick-Room **
- plane { x,-90 texture { Brick rotate y*90 }} // left wall
- plane { x, 90 hollow on texture { Brick rotate y* 90}} // right wall
- plane { z, 70 hollow on texture { Brick }} // back wall
- plane { y, 0 texture { Brick } translate -y*8 } // floor
- // ** The Glass-Balls **
- // * Declare the variables for the random position of the balls (x,y and z-axis)
- #declare Rx = seed(now * 51);
- #declare Ry = seed(now * 121);
- #declare Rz = seed(now * 242);
- #declare iRadiusRND = seed(now * 368);
- #declare iCounter = 0;
- #declare iIncrement = 1; //Iterations
- #declare iLoopEnd = 300; // This is for how many Balls will be created
- #declare irandMulti = seed(now * 151) + 150;
- #while (iCounter < iLoopEnd)
- #declare RVx = rand(Rx) * irandMulti;
- #declare RVy = rand(Ry) * irandMulti;
- #declare RVz = rand(Rz) * irandMulti;
- #declare iRadius = rand(iRadiusRND) * 20; // how big is a GlassBall
- sphere
- {
- <RVx,RVy,RVz>, iRadius
- texture
- {
- pigment { White filter 0.95}
- finish { F_Glass3 }
- }
- interior
- {I_Glass
- caustics 1
- }
- photons
- {
- target 0.5
- //target 1.0
- refraction on
- reflection on
- }
- }
- // *** a Debug-Line ***
- #debug concat("iCounter: ", str(int(iCounter),1,1), " RVx: ", str(RVx,1 ,1) , " RVy: ", str(RVy,1 ,1) , " RVz: ", str(RVz,1 ,1), " iRadius: ", str(iRadius,1,1) ,"\n")
- #declare iCounter=iCounter+iIncrement;
- #end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement