// triangle or smooth-triangle mesh FINITE (no CSG) shape
// NOTE: Each triangle can be independently textured,
//       remaining triangles get texture at bottom
//       For the individual triangles you have to use declared textures


#declare T0=texture { pigment { color rgb<1,0.5,0> } } 
#declare T1=texture { pigment { color rgb<1,0.7,0> } } 
#declare T2=texture { pigment { color rgb<0.3,0.7,0> } } 
#declare T3=texture { pigment { color rgb<0.1,0.8,0>*0.6 } } 
#declare T4=texture { pigment { color rgb<0.7,1,0> } } 
#declare T5=texture { pigment { color rgb<1,1,0>*1.2 } } 

mesh { // box example here 
  /* top side */
  triangle { <-2,  2, -2>, < 2,  2, -2>, < 2,  2,  2> texture { T1 } }
  triangle { <-2,  2, -2>, <-2,  2,  2>, < 2,  2,  2> texture { T0 } }
  /* bottom side */
  triangle { <-2, -2, -2>, < 2, -2, -2>, < 2, -2,  2> }
  triangle { <-2, -2, -2>, <-2, -2,  2>, < 2, -2,  2> }
  /* left side */
  triangle { <-2, -2, -2>, <-2, -2,  2>, <-2,  2,  2> }
  triangle { <-2, -2, -2>, <-2,  2, -2>, <-2,  2,  2> }
  /* right side */
  triangle { < 2, -2, -2>, < 2, -2,  2>, < 2,  2,  2> texture { T5 } }
  triangle { < 2, -2, -2>, < 2,  2,  2>, < 2,  2, -2> texture { T4 } }
  /* front side */
  triangle { <-2, -2, -2>, < 2, -2, -2>, <-2,  2, -2> texture { T2 } }
  triangle { <-2,  2, -2>, < 2,  2, -2>, < 2, -2, -2> texture { T3 } }
  /* back side */
  triangle { <-2, -2,  2>, < 2, -2,  2>, <-2,  2,  2> }
  triangle { <-2,  2,  2>, < 2,  2,  2>, < 2, -2,  2> }
  texture
  { // the rest gets this texture
    pigment { color rgb<1, 1, 1> }
    finish { phong 1 }
  }
 scale<1,1,1>
 rotate<0,0,0>
 translate<0,0,0>

}
