// ======================================================================
// CORES E TEXTURAS

background { color rgb < 0,0,0 > }


// ======================================================================
// DESCRIÇÃO DA CENA 

#declare tx_prisma = texture {
    pigment { color rgb<1,1,1> }
    finish { diffuse 1 }
}

#declare tx_parede = texture {
    pigment { color rgb<1,1,1> }
    finish { diffuse 1 }
}

// Partes da cena

#declare prisma = difference {
    prism {
        linear_sweep
        linear_spline
        0, 1, 7,
        <0.3,0.5>, <-0.3,0.5>, <-0.5,0>, <-0.3,-0.5>, <0.3,-0.5>, <0.5,0>, <0.3,0.5>
        texture { tx_prisma }
    }
    
    prism {
        linear_sweep
        linear_spline
        -0.5, 1.5, 7,
        <0.29,0.49>, <-0.29,0.49>, <-0.49,0>, <-0.29,-0.49>, <0.29,-0.49>, <0.49,0>, <0.29,0.49>
        texture { tx_prisma }
    }
}

#declare texto = text {
    ttf "comic.ttf" "povray" 1, 0
    texture { tx_prisma }
}

#declare projetor = union {
    light_source { <0.15,0.5,0> rgb <1,0,1> }
    difference {
        object { prisma rotate 90*y }
        object { texto scale 0.25 rotate <90,0,90> translate <0.3,0.15,-0.05> }
    }
}

#declare parede = box {
    <-5,-0.2,-2> <5,0.2,2>
    texture { tx_parede }
}

// Aqui está a cena, finalmente:

object { projetor rotate <0,180,135> scale -1 }
object { parede rotate z*45 translate <-2,2,0>}


#include "camlight.inc"
#declare centro_cena = < 0,2,0 >;
#declare raio_cena = 5;
#declare dir_camera = < 90, 15, 0 >; // 0, -1, 90 for XY
#declare dist_camera = 4*raio_cena;
#declare intens_luz = 0.2;
camlight(centro_cena, raio_cena, dir_camera, dist_camera , z, intens_luz)