Skip to content

Instantly share code, notes, and snippets.

@quephird
Created November 6, 2015 00:00
Show Gist options
  • Save quephird/66ea76cc56450242e34d to your computer and use it in GitHub Desktop.
Save quephird/66ea76cc56450242e34d to your computer and use it in GitHub Desktop.
#version 3.7;
global_settings { assumed_gamma 1.0 }
#include "colors.inc"
#include "glass.inc"
#include "textures.inc"
// Random color generator with moving seed
#declare My_seed = seed(now * 100000);
#macro RandomColor()
<rand(My_seed), rand(My_seed), rand(My_seed)>
#end
// Main camera
camera {
location <0.0, 10.0, 20.0>
look_at <0.0, 3.0, 0.0>
up <0, 1, 0>
}
// Main light
light_source{<10, 10, -10> color White}
plane {
<0, 1, 0>, 1
pigment {color <0.5, 0.5, 0.8>}
}
#macro RoundedCube (rgbVector, w, l)
superellipsoid {
<0.25, 0.25>
scale <2*w, 1.0, 2*l>
pigment { color rgbVector transmit 0.7 filter 0.1 }
material { M_Glass3 }
finish {
phong 1.0
diffuse 0.7
reflection 0.3
}
}
#end
#for (i, 0, 2, 1)
#for (j, 0, 5, 1)
object {
RoundedCube( <0.1, 0.2+0.4*rand(My_seed), 1.0*rand(My_seed) >, 1.0+0.5*rand(My_seed), 1.0+0.5*rand(My_seed))
rotate <0.0, 90.0*rand(My_seed), 0.0>
translate <9.0*(i-1), 2.0*j, 0.0>
}
#end
#end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment