  #include "colors.inc"
#include "librerias.inc"

camera {
  location <10,10,-20>
  look_at <0,0,0>
}

light_source {<10,10,-15> color White}
#declare a=<-3, 2, -3>;
#declare b=<-3, 2, -7>;
#declare c=<-3, 4, -7>;
#declare d=<-3, 4, -3>;
#declare e=<-6, 2, -3>;
#declare f=<-6, 2, -7>;

#declare queso = union {
    // Caras laterales
    triangle{
       a,d,e
       pigment{color Cyan}
    }
    triangle{
       b,c,f
       pigment{color Cyan}
    }
    
    // Cara rectangular
    triangle{
       a,d,c
       pigment{color Cyan}
    }
    triangle{
       a,b,c
       pigment{color Cyan}
    }
    
    // Cara superior
    triangle{
       c,e,f
       pigment{color Cyan}
    }
    triangle{
       c,d,e
       pigment{color Cyan}
    }
    // Base
    triangle{
       a,e,f
       pigment{color Red}
    }
    triangle{
       a,b,f
       pigment{color Red}
    }
} 

object{
  queso
  
    // 1. Traslación de la figura donde Tx: 3, Ty:-2 y Tz: 3  
    /*
    matrix<   
        1, 0, 0,
        0, 1, 0,
        0, 0, 1,
        3, -2, 3
    > */
    
    // 2. Rotacion en Y -90
    /*
    matrix<   
        0, 0, 1,
        0, 1, 0,
        -1, 0, 0,
        -3, -2, 3     
    > */
    // 3. Reflexion en XY 
    /*
    matrix<   
        0, 0, -1,
        0, 1, 0,
        -1, 0, 0,
        -3, -2,  -3      
    > */
    // 4. Escalación donde Sx: 1, Sy: 2 y Sz:2 
    /*
    matrix<   
       0, 0, -2,
       0, 2, 0,
       -1, 0, 0,
       -3, -4, -6     
    > */
    // 5. Matriz de transformacion compuesta final
    //    Traslación de la figura donde Tx: 3, Ty:0 y Tz: 2
    /*
    matrix<   
        0, 0, -2,
        0, 2, 0,
        -1, 0, 0,
        0, -4, -4
    > */
    
}

plane  { y,0 pigment {checker Black White }}
ejes3D

