+calculate_texture_coords(ModeInfo *mi, texture *texture, vector2f t[3]) {
+
+ /* equilateral triangle rotating around centre */
+ gleidestruct *gp = &gleidescope[MI_SCREEN(mi)];
+ GLfloat width = texture->max_tx - texture->min_tx;
+ GLfloat height = texture->max_ty - texture->min_ty;
+ /* centre */
+ GLfloat centre_x = texture->min_tx + (width * .5);
+ GLfloat centre_y = texture->min_ty + (height * .5);
+ /* m radius and t radius should be = .5 */
+ /* triangle radius is 30% available space */
+ GLfloat t_radius_x = width * .3;
+ GLfloat t_radius_y = height * .3;
+ /* movement radius is 30% available space */
+ GLfloat m_radius_x = width * .2;
+ GLfloat m_radius_y = height * .2;
+ GLfloat angle2;
+
+ /* centre of triangle */
+ GLfloat angle = (gp->ymouse * 2 * M_PI) + (gp->tangle * RADIANS); /* to radians */
+ GLfloat t_centre_x = centre_x + m_radius_x * cos(texture->x_period * angle + texture->x_phase);
+ GLfloat t_centre_y = centre_y + m_radius_y * sin(texture->y_period * angle + texture->y_phase);
+
+#if 0
+ printf("WH: %f, %f - tWH: %f, %f\n", width, height, texture->width, texture->height);
+ printf("size: (%f, %f)\n", width, height);
+ printf("centre: (%f, %f)\n", centre_x, centre_y);
+#endif
+
+ angle2 = texture->r_period * angle + texture->r_phase;
+ t[0].x = t_centre_x + t_radius_x * cos(angle2);
+ t[0].y = t_centre_y + t_radius_y * sin(angle2);
+ t[1].x = t_centre_x + t_radius_x * cos(angle2 + ANGLE_120);
+ t[1].y = t_centre_y + t_radius_y * sin(angle2 + ANGLE_120);
+ t[2].x = t_centre_x + t_radius_x * cos(angle2 + ANGLE_240);
+ t[2].y = t_centre_y + t_radius_y * sin(angle2 + ANGLE_240);
+
+#if 0
+ printf("texcoords:[%f,%f]->[%f,%f](%f,%f)\n", t[0].x, t[0].y, t[1].x, t[1].y, texture->max_tx, texture->max_ty);
+#endif
+}
+#endif
+
+#if 0
+/* corners into corners - meant to maximise coverage */
+static void
+calculate_texture_coords(ModeInfo *mi, texture *texture, vector2f t[3]) {
+
+ /* equilateral triangle rotating around centre */
+ gleidestruct *gp = &gleidescope[MI_SCREEN(mi)];
+ GLfloat width = texture->max_tx - texture->min_tx;
+ GLfloat height = texture->max_ty - texture->min_ty;
+ /* centre */
+ GLfloat centre_x = texture->min_tx + (width * .5);
+ GLfloat centre_y = texture->min_ty + (height * .5);
+ /* m radius and t radius should be = .5 */
+ /* triangle radius calculated using maths 8) */
+#define TRADIUS (M_SQRT2 - 1.0)
+#define MRADIUS (1.0 - (M_SQRT2 / 2.0))
+ GLfloat t_radius_x = width * TRADIUS * .95;
+ GLfloat t_radius_y = height * TRADIUS * .95;
+ /* movement radius also calculated using maths */
+ GLfloat m_radius_x = width * MRADIUS * .95;
+ GLfloat m_radius_y = height * MRADIUS * .95;
+ GLfloat angle, angle2;
+ GLfloat t_centre_x, t_centre_y;
+
+ /* centre of triangle */
+ angle = gp->tangle * RADIANS; /* to radians */
+ t_centre_x = centre_x + m_radius_x * cos(angle);
+ t_centre_y = centre_y + m_radius_y * sin(angle);
+#if 0
+ printf("angle: %f, %f\n", angle, gp->tangle);
+ printf("tcentre: %f,%f\n", t_centre_x, t_centre_y);
+ printf("tradius: %f,%f\n", t_radius_x, t_radius_y);
+
+ printf("size: (%f, %f)\n", width, height);
+ printf("centre: (%f, %f)\n", centre_x, centre_y);
+ printf("centre: (%f, %f)\n", centre_x, centre_y);
+ printf("TRADIUS: %f\n", TRADIUS);
+ printf("MRADIUS: %f\n", MRADIUS);
+#endif
+
+ /* angle2 is tied to tangle */
+ angle2 = (180.0 - ((30.0 / 90.0) * gp->tangle)) * RADIANS;
+#if 0
+ printf("Angle1: %f\tAngle2: %f\n", angle / RADIANS, angle2 / RADIANS);
+#endif
+ t[0].x = t_centre_x + t_radius_x * cos(angle2);
+ t[0].y = t_centre_y + t_radius_y * sin(angle2);
+ t[1].x = t_centre_x + t_radius_x * cos(angle2 + ANGLE_120);
+ t[1].y = t_centre_y + t_radius_y * sin(angle2 + ANGLE_120);
+ t[2].x = t_centre_x + t_radius_x * cos(angle2 + ANGLE_240);
+ t[2].y = t_centre_y + t_radius_y * sin(angle2 + ANGLE_240);
+
+#if 0
+ printf("texcoords:[%f,%f][%f,%f][%f,%f]\n", t[0].x, t[0].y, t[1].x, t[1].y, t[2].x, t[2].y);
+#endif
+}
+#endif
+
+static int
+draw_hexagons(ModeInfo *mi, int translucency, texture *texture)