real[][] T = {T[0:13],T[13:26],T[0:13]};
T = transpose(T);
size3(15cm);
real w = 10;
real h = 5;
currentprojection = orthographic(2*(L,h,w),Y);
draw((L,t,0)--(L,0,0)--(L,0,w)--(0,0,w)--(0,-h,w));
draw((0,t,w)--(0,t+h,w)--(0,t+h,0)--(0,t,0));
draw((L,0,w)--(L,t,w)--(0,t,w)--(0,t,0)--(L,t,0)--(L,t,w));
real wo2 = 0.5*w;
draw((0,0,wo2)--(0,t,wo2)--(L,t,wo2)--(L,0,wo2)--cycle);
material lookupColour(int m,int n)
{
int index = round(Palette.length*(T[m-1][n-1]-60)/(100-60));
if(index >= Palette.length) index = Palette.length-1;
return emissive(Palette[index]);
}
draw(shift(0,1,0)*rightsquare,lookupColour(1,2));
for(int i = 2; i < 13; ++i)
{
draw(shift(i-1,1,0)*square,lookupColour(i,2));
}
draw(shift(12,1,0)*leftsquare,lookupColour(13,2));
draw(shift(0,2,0)*SEcorner,lookupColour(1,3));
draw(shift(0,0,0)*NEcorner,lookupColour(1,1));
for(int i = 2; i < 13; ++i)
{
draw(shift(i-1,0,0)*topsquare,lookupColour(i,1));
draw(shift(i-1,2,0)*bottomsquare,lookupColour(i,3));
}
draw(shift(12,2,0)*SWcorner,lookupColour(13,3));
draw(shift(12,0,0)*NWcorner,lookupColour(13,1));