+/* -- Icosahedron -- */
+#define ICOSAHEDRON_NUM_VERT 12
+#define ICOSAHEDRON_NUM_FACES 20
+#define ICOSAHEDRON_NUM_EDGE_PER_FACE 3
+#define ICOSAHEDRON_VERT_PER_OBJ (ICOSAHEDRON_NUM_FACES*ICOSAHEDRON_NUM_EDGE_PER_FACE)
+#define ICOSAHEDRON_VERT_ELEM_PER_OBJ (ICOSAHEDRON_VERT_PER_OBJ*3)
+#define ICOSAHEDRON_VERT_PER_OBJ_TRI ICOSAHEDRON_VERT_PER_OBJ
+/* Vertex Coordinates */
+static GLfloat icosahedron_v[ICOSAHEDRON_NUM_VERT*3] =
+{
+ 1.0f, 0.0f, 0.0f,
+ 0.447213595500f, 0.894427191000f, 0.0f,
+ 0.447213595500f, 0.276393202252f, 0.850650808354f,
+ 0.447213595500f, -0.723606797748f, 0.525731112119f,
+ 0.447213595500f, -0.723606797748f, -0.525731112119f,
+ 0.447213595500f, 0.276393202252f, -0.850650808354f,
+ -0.447213595500f, -0.894427191000f, 0.0f,
+ -0.447213595500f, -0.276393202252f, 0.850650808354f,
+ -0.447213595500f, 0.723606797748f, 0.525731112119f,
+ -0.447213595500f, 0.723606797748f, -0.525731112119f,
+ -0.447213595500f, -0.276393202252f, -0.850650808354f,
+ - 1.0f, 0.0f, 0.0f
+};
+/* Normal Vectors:
+ * icosahedron_n[i][0] = ( icosahedron_v[icosahedron_vi[i][1]][1] - icosahedron_v[icosahedron_vi[i][0]][1] ) * ( icosahedron_v[icosahedron_vi[i][2]][2] - icosahedron_v[icosahedron_vi[i][0]][2] ) - ( icosahedron_v[icosahedron_vi[i][1]][2] - icosahedron_v[icosahedron_vi[i][0]][2] ) * ( icosahedron_v[icosahedron_vi[i][2]][1] - icosahedron_v[icosahedron_vi[i][0]][1] ) ;
+ * icosahedron_n[i][1] = ( icosahedron_v[icosahedron_vi[i][1]][2] - icosahedron_v[icosahedron_vi[i][0]][2] ) * ( icosahedron_v[icosahedron_vi[i][2]][0] - icosahedron_v[icosahedron_vi[i][0]][0] ) - ( icosahedron_v[icosahedron_vi[i][1]][0] - icosahedron_v[icosahedron_vi[i][0]][0] ) * ( icosahedron_v[icosahedron_vi[i][2]][2] - icosahedron_v[icosahedron_vi[i][0]][2] ) ;
+ * icosahedron_n[i][2] = ( icosahedron_v[icosahedron_vi[i][1]][0] - icosahedron_v[icosahedron_vi[i][0]][0] ) * ( icosahedron_v[icosahedron_vi[i][2]][1] - icosahedron_v[icosahedron_vi[i][0]][1] ) - ( icosahedron_v[icosahedron_vi[i][1]][1] - icosahedron_v[icosahedron_vi[i][0]][1] ) * ( icosahedron_v[icosahedron_vi[i][2]][0] - icosahedron_v[icosahedron_vi[i][0]][0] ) ;
+*/
+static GLfloat icosahedron_n[ICOSAHEDRON_NUM_FACES*3] =
+{
+ 0.760845213037948f, 0.470228201835026f, 0.341640786498800f,
+ 0.760845213036861f, -0.179611190632978f, 0.552786404500000f,
+ 0.760845213033849f, -0.581234022404097f, 0.0f,
+ 0.760845213036861f, -0.179611190632978f, -0.552786404500000f,
+ 0.760845213037948f, 0.470228201835026f, -0.341640786498800f,
+ 0.179611190628666f, 0.760845213037948f, 0.552786404498399f,
+ 0.179611190634277f, -0.290617011204044f, 0.894427191000000f,
+ 0.179611190633958f, -0.940456403667806f, 0.0f,
+ 0.179611190634278f, -0.290617011204044f, -0.894427191000000f,
+ 0.179611190628666f, 0.760845213037948f, -0.552786404498399f,
+ -0.179611190633958f, 0.940456403667806f, 0.0f,
+ -0.179611190634277f, 0.290617011204044f, 0.894427191000000f,
+ -0.179611190628666f, -0.760845213037948f, 0.552786404498399f,
+ -0.179611190628666f, -0.760845213037948f, -0.552786404498399f,
+ -0.179611190634277f, 0.290617011204044f, -0.894427191000000f,
+ -0.760845213036861f, 0.179611190632978f, -0.552786404500000f,
+ -0.760845213033849f, 0.581234022404097f, 0.0f,
+ -0.760845213036861f, 0.179611190632978f, 0.552786404500000f,
+ -0.760845213037948f, -0.470228201835026f, 0.341640786498800f,
+ -0.760845213037948f, -0.470228201835026f, -0.341640786498800f,
+};
+
+/* Vertex indices */
+static GLubyte icosahedron_vi[ICOSAHEDRON_VERT_PER_OBJ] =
+{
+ 0, 1, 2 ,
+ 0, 2, 3 ,
+ 0, 3, 4 ,
+ 0, 4, 5 ,
+ 0, 5, 1 ,
+ 1, 8, 2 ,
+ 2, 7, 3 ,
+ 3, 6, 4 ,
+ 4, 10, 5 ,
+ 5, 9, 1 ,
+ 1, 9, 8 ,
+ 2, 8, 7 ,
+ 3, 7, 6 ,
+ 4, 6, 10 ,
+ 5, 10, 9 ,
+ 11, 9, 10 ,
+ 11, 8, 9 ,
+ 11, 7, 8 ,
+ 11, 6, 7 ,
+ 11, 10, 6
+};
+DECLARE_SHAPE_CACHE(icosahedron,Icosahedron,ICOSAHEDRON)
+
+/* -- Octahedron -- */
+#define OCTAHEDRON_NUM_VERT 6
+#define OCTAHEDRON_NUM_FACES 8
+#define OCTAHEDRON_NUM_EDGE_PER_FACE 3
+#define OCTAHEDRON_VERT_PER_OBJ (OCTAHEDRON_NUM_FACES*OCTAHEDRON_NUM_EDGE_PER_FACE)
+#define OCTAHEDRON_VERT_ELEM_PER_OBJ (OCTAHEDRON_VERT_PER_OBJ*3)
+#define OCTAHEDRON_VERT_PER_OBJ_TRI OCTAHEDRON_VERT_PER_OBJ
+
+/* Vertex Coordinates */
+static GLfloat octahedron_v[OCTAHEDRON_NUM_VERT*3] =
+{
+ 1.f, 0.f, 0.f,
+ 0.f, 1.f, 0.f,
+ 0.f, 0.f, 1.f,
+ -1.f, 0.f, 0.f,
+ 0.f, -1.f, 0.f,
+ 0.f, 0.f, -1.f,
+
+};
+/* Normal Vectors */
+static GLfloat octahedron_n[OCTAHEDRON_NUM_FACES*3] =
+{
+ 0.577350269189f, 0.577350269189f, 0.577350269189f, /* sqrt(1/3) */
+ 0.577350269189f, 0.577350269189f,-0.577350269189f,
+ 0.577350269189f,-0.577350269189f, 0.577350269189f,
+ 0.577350269189f,-0.577350269189f,-0.577350269189f,
+ -0.577350269189f, 0.577350269189f, 0.577350269189f,
+ -0.577350269189f, 0.577350269189f,-0.577350269189f,
+ -0.577350269189f,-0.577350269189f, 0.577350269189f,
+ -0.577350269189f,-0.577350269189f,-0.577350269189f
+
+};
+
+/* Vertex indices */
+static GLubyte octahedron_vi[OCTAHEDRON_VERT_PER_OBJ] =
+{
+ 0, 1, 2,
+ 0, 5, 1,
+ 0, 2, 4,
+ 0, 4, 5,
+ 3, 2, 1,
+ 3, 1, 5,
+ 3, 4, 2,
+ 3, 5, 4
+};
+DECLARE_SHAPE_CACHE(octahedron,Octahedron,OCTAHEDRON)
+
+/* -- RhombicDodecahedron -- */
+#define RHOMBICDODECAHEDRON_NUM_VERT 14
+#define RHOMBICDODECAHEDRON_NUM_FACES 12
+#define RHOMBICDODECAHEDRON_NUM_EDGE_PER_FACE 4
+#define RHOMBICDODECAHEDRON_VERT_PER_OBJ (RHOMBICDODECAHEDRON_NUM_FACES*RHOMBICDODECAHEDRON_NUM_EDGE_PER_FACE)
+#define RHOMBICDODECAHEDRON_VERT_ELEM_PER_OBJ (RHOMBICDODECAHEDRON_VERT_PER_OBJ*3)
+#define RHOMBICDODECAHEDRON_VERT_PER_OBJ_TRI (RHOMBICDODECAHEDRON_VERT_PER_OBJ+RHOMBICDODECAHEDRON_NUM_FACES*2) /* 2 extra edges per face when drawing quads as triangles */
+
+/* Vertex Coordinates */
+static GLfloat rhombicdodecahedron_v[RHOMBICDODECAHEDRON_NUM_VERT*3] =
+{
+ 0.0f, 0.0f, 1.0f,
+ 0.707106781187f, 0.0f, 0.5f,
+ 0.0f, 0.707106781187f, 0.5f,
+ -0.707106781187f, 0.0f, 0.5f,
+ 0.0f, -0.707106781187f, 0.5f,
+ 0.707106781187f, 0.707106781187f, 0.0f,
+ -0.707106781187f, 0.707106781187f, 0.0f,
+ -0.707106781187f, -0.707106781187f, 0.0f,
+ 0.707106781187f, -0.707106781187f, 0.0f,
+ 0.707106781187f, 0.0f, -0.5f,
+ 0.0f, 0.707106781187f, -0.5f,
+ -0.707106781187f, 0.0f, -0.5f,
+ 0.0f, -0.707106781187f, -0.5f,
+ 0.0f, 0.0f, -1.0f
+};
+/* Normal Vectors */
+static GLfloat rhombicdodecahedron_n[RHOMBICDODECAHEDRON_NUM_FACES*3] =
+{
+ 0.353553390594f, 0.353553390594f, 0.5f,
+ -0.353553390594f, 0.353553390594f, 0.5f,
+ -0.353553390594f, -0.353553390594f, 0.5f,
+ 0.353553390594f, -0.353553390594f, 0.5f,
+ 0.0f, 1.0f, 0.0f,
+ - 1.0f, 0.0f, 0.0f,
+ 0.0f, - 1.0f, 0.0f,
+ 1.0f, 0.0f, 0.0f,
+ 0.353553390594f, 0.353553390594f, -0.5f,
+ -0.353553390594f, 0.353553390594f, -0.5f,
+ -0.353553390594f, -0.353553390594f, -0.5f,
+ 0.353553390594f, -0.353553390594f, -0.5f
+};
+
+/* Vertex indices */
+static GLubyte rhombicdodecahedron_vi[RHOMBICDODECAHEDRON_VERT_PER_OBJ] =
+{
+ 0, 1, 5, 2,
+ 0, 2, 6, 3,
+ 0, 3, 7, 4,
+ 0, 4, 8, 1,
+ 5, 10, 6, 2,
+ 6, 11, 7, 3,
+ 7, 12, 8, 4,
+ 8, 9, 5, 1,
+ 5, 9, 13, 10,
+ 6, 10, 13, 11,
+ 7, 11, 13, 12,
+ 8, 12, 13, 9
+};
+DECLARE_SHAPE_CACHE_DECOMPOSE_TO_TRIANGLE(rhombicdodecahedron,RhombicDodecahedron,RHOMBICDODECAHEDRON)