7.3 A rotating polygon in animation 213
break;
case ’+’:
tdir = TRANS;
break;
case 27: /* ESC */
case ’q’:
vexit();
exit(0);
}
}
//--- Done:
vexit();
return(0);
}
//--- vertices
static float xyz[12][3]
={
{0.000000, 0.000000, 1.0},
{0.809017, -0.587785, 0.500000},
{0.809017, 0.587785, 0.500000},
{-0.309017, 0.951057, 0.500000},
{-1.000000, 0.000000, 0.500000},
{-0.309017, -0.951057, 0.500000},
{1.000000, 0.000000, -0.500000},
{0.309017, 0.951057, -0.500000},
{-0.809017, 0.587785, -0.500000},
{-0.809017, -0.587785, -0.500000},
{0.309017, -0.951057, -0.500000},
{0.000000, 0.000000, -1.0}
};
//--- connectivity table
static int ncon[20][3]
={
{1, 2, 3},{1, 3, 4},{1, 4, 5},{1, 5, 6},
{1, 6, 2},{2, 7, 3},{3, 8, 4},{4, 9, 5},
{5, 10, 6},{6, 11, 2},{7, 8, 3},{8, 9, 4},
{9, 10, 5},{10, 11, 6},{11, 7, 2},{7, 12, 8},
{8, 12, 9},{9, 12, 10},{10, 12, 11},{11, 12, 7}
};
//--- drawshape