//sub surface materials using media. #if ( final_frame > 0 ) #declare nFrameNumber = frame_number-40; #declare nFinalFrame = final_frame; #else //when not rendering animation pick a nice frame #declare nFrameNumber = 180; #declare nFinalFrame = 199; #end #default { finish { ambient 0 diffuse 1 } } global_settings { max_trace_level 4//8 assumed_gamma 1 } #include "lightsys3/CIE.inc" #macro m_vPow( V, P ) #end #macro m_Pattern() agate agate_turb .2 turbulence .4 omega .35 octaves 5 scale .3 rotate <60,45,0> translate .16*y colour_map { [.00 rgb .3] [.20 rgb 1] [.30 rgb <.2,.03,.0>] [.50 rgb <.4,.1,.0>] [.60 rgb <.7,.4,.1>] [.70 rgb <.4,.1,.0>] // [.80 rgb <.4,.1,.0>] [1.0 rgb <.2,.03,.0>] //[.90 rgb <.6,.3,.1>] //[1.0 rgb <1,.7,.3>] } #end #declare oPyramid = merge { #declare f = .05; #declare p0 = <0,1,0>; #declare p1 = < .7,0, .7>; #declare p2 = <-.7,0, .7>; #declare p3 = < .7,0,-.7>; #declare p4 = <-.7,0,-.7>; //curved edges sphere { p0, f } sphere { p1, f } sphere { p2, f } sphere { p3, f } sphere { p4, f } cylinder { p0, p1, f } cylinder { p0, p2, f } cylinder { p0, p3, f } cylinder { p0, p4, f } cylinder { p1, p2, f } cylinder { p2, p4, f } cylinder { p4, p3, f } cylinder { p3, p1, f } intersection { #declare oOuterPyramid = intersection { //faces plane { #declare vNorm0 = -y; vNorm0, f } plane { #declare vNorm1 = vnormalize(vcross(p2-p0,p1-p0)); vNorm1, vdot( vNorm1, p0 ) + f } plane { #declare vNorm2 = vnormalize(vcross(p1-p0,p3-p0)); vNorm2, vdot( vNorm2, p0 ) + f } plane { #declare vNorm3 = vnormalize(vcross(p3-p0,p4-p0)); vNorm3, vdot( vNorm3, p0 ) + f } plane { #declare vNorm4 = vnormalize(vcross(p4-p0,p2-p0)); vNorm4, vdot( vNorm4, p0 ) + f } } object { oOuterPyramid } //cut in edges #macro m_EdgeCut( v0, v1, n0, n1 ) merge { plane { vnormalize(vcross(v0-v1, n0)), 0 } plane { vnormalize(vcross(v1-v0, n1)), 0 } translate v0 bounded_by { cylinder { v0*2-v1, v1*2-v0, f*sqrt(2) } } } #end m_EdgeCut( p0, p1, vNorm1, vNorm2 ) m_EdgeCut( p0, p2, vNorm4, vNorm1 ) m_EdgeCut( p0, p3, vNorm2, vNorm3 ) m_EdgeCut( p0, p4, vNorm3, vNorm4 ) m_EdgeCut( p1, p2, vNorm1, vNorm0 ) m_EdgeCut( p3, p1, vNorm2, vNorm0 ) m_EdgeCut( p4, p3, vNorm3, vNorm0 ) m_EdgeCut( p2, p4, vNorm4, vNorm0 ) } bounded_by { oOuterPyramid } translate f*y scale .25 } /* intersection { plane { -y, 1 } plane { vnormalize(y+x), 0 } plane { vnormalize(y-x), 0 } plane { vnormalize(y+z), 0 } plane { vnormalize(y-z), 0 } //fillet edges #declare f = .006; plane { vnormalize(-y+x*2), -f translate x-y } plane { vnormalize(-y-x*2), -f translate -x-y } plane { vnormalize(-y+z*2), -f translate z-y } plane { vnormalize(-y-z*2), -f translate -z-y } plane { vnormalize(2*y+x+z), -f } plane { vnormalize(2*y-x+z), -f } plane { vnormalize(2*y+x-z), -f } plane { vnormalize(2*y-x-z), -f } scale <.2,.25,.2> translate y*.25 }*/ #declare oMazeThing = intersection { box { -1, 1 } box { <-.5,-.5,-1.1>, <1.1,1.1,-.5> inverse } box { <-.499,-.499,-1.1>, <0,1.1,.5> inverse } box { <-.001,-.498,-1.1>, <1.1,.5,0> inverse } box { <-.001,-.001,-1.1>, <.5,1.1,-.001> inverse } translate y scale .2 } //sphere { 0, .2 translate .2*y object { oPyramid //object { oMazeThing no_image no_shadow double_illuminate texture { pigment { rgb .5 } finish { //reflection { 0, .8 falloff 5 } conserve_energy //specular 5 roughness .005 phong 2 phong_size 500 } } } //sphere { 0, .2 translate .2*y object { oPyramid //object { oMazeThing hollow on no_reflection #declare f_Pattern = function { pigment { m_Pattern() } } material { //texture { pigment { m_Pattern() } } #local fGlimmer = 0; //turn off this effect it looks crap #local fDensity = 20; #local fAbsorb = 1; interior { ior 1.3 media { scattering { 1, rgb fDensity extinction 0 } absorption 0 density { m_Pattern() } } media { absorption fAbsorb density { rgb fDensity } } media { //reflective facet-like things scattering { 5, rgb fGlimmer extinction 1 eccentricity -.7 } absorption 0//fGlimmer density { pigment_pattern { spotted scale .07 triangle_wave } poly_wave 50 } } } texture { pigment { rgbt 1 } finish { reflection { .01, .8 falloff 5 exponent .5 } conserve_energy //specular 5 roughness .005 phong 2 phong_size 500 } } } } //todo: crystals - i.e. internal cracks //blah... iso surface? normals? union { cylinder { -y*.001, -y*.1, 1 } torus { 1, .05 translate -.051*y } pigment { rgb Kelvin(8000)*1.2 } texture { pigment { rgbt 1 } finish { reflection { .03, .1 falloff 5 exponent .8 } conserve_energy phong 2 phong_size 100 } } } light_source { (y-x)*20 rgb .015*Kelvin(7000) } light_source { (y-z)*20 rgb .01*Kelvin(7000) } light_source { (y+x)*20 rgb .015*Kelvin(7000) } light_source { (y+z)*20 rgb .02*Kelvin(7000) } light_source { //<1,12,-15> //<1,.4,.5> <1,.25,.5>*1000 rgb 1*Kelvin(6000) } sky_sphere { pigment { //layer some colouration under the "lighting" /*gradient y scale 2 translate -1 colour_map { [0 rgb m_vPow(<.75,.5,.25>,2)] [.5 rgb m_vPow(<.75,.5,.25>,1)] [1 rgb m_vPow(<.75,.5,.25>,0)] }*/ rgb Kelvin(7000)*.8 } pigment { boxed //mapped on the sky sphere this gives the impression of lighting on the walls in a room. colour_map { [0 rgb 0 transmit 1] [1-1/sqrt(3) rgb 0 transmit .2] } } //window (a little curved but I'm to lazy to do it nicely!) pigment { boxed scale <1,.4,.3> translate <1,0,0> rotate <0,0,16> colour_map { [.00 rgbt 1] [.15 rgb Kelvin(7000)*4] } } rotate -30*y } camera { right x*image_width/image_height up y direction z*8 location <2,3,-3> look_at .05*y rotate <-sin(2*pi*nFrameNumber/(nFinalFrame+1))*20-15, 360*nFrameNumber/(nFinalFrame+1),0> }