/* * texas.c * * FUNCTION: * Draws a brand in the shape of Texas. Both the handle, and the * cross-section of the brand are in the shape of Texas. * * Note that the contours are specified in clockwise order. * Thus, enabling backfacing polygon removal will cause the front * polygons to disappear. * * HISTORY: * -- created by Linas Vepstas October 1991 * -- heavily modified to draw more texas shapes, Feb 1993, Linas * -- converted to use GLUT -- December 1995, Linas * Copyright (c) 1991, 1993, 1995 Linas Vepstas * */ /* required include files */ #include #include #include #include #include #include "main.h" /* =========================================================== */ #define HNUM 4 double brand_points[HNUM][3]; float brand_colors [HNUM][3]; #define TSCALE 4.0 #define BPTS(x,y,z) { \ brand_points[i][0] = TSCALE * (x); \ brand_points[i][1] = TSCALE * (y); \ brand_points[i][2] = TSCALE * (z); \ i++; \ } #define BCOLS(r,g,b) { \ brand_colors[i][0] = (r); \ brand_colors[i][1] = (g); \ brand_colors[i][2] = (b); \ i++; \ } #define NUMPOINTS 18 double tspine[NUMPOINTS][3]; float tcolors [NUMPOINTS][3]; #define TPTS(x,y) { \ tspine[i][0] = TSCALE * (x); \ tspine[i][1] = TSCALE * (y); \ tspine[i][2] = TSCALE * (0.0); \ i++; \ } #define TCOLS(r,g,b) { \ tcolors[i][0] = (r); \ tcolors[i][1] = (g); \ tcolors[i][2] = (b); \ i++; \ } /* =========================================================== */ static void init_spine (void) { int i; int ir, ig, ib; float r, g, b; i=0; TPTS (-1.5, 2.0); /* panhandle */ TPTS (-0.75, 2.0); TPTS (-0.75, 1.38); TPTS (-0.5, 1.25); TPTS (0.88, 1.12); TPTS (1.0, 0.62); TPTS (1.12, 0.1); TPTS (0.5, -0.5); TPTS (0.2, -1.12); /* corpus */ TPTS (0.3, -1.5); /* brownsville */ TPTS (-0.25, -1.45); TPTS (-1.06, -0.3); TPTS (-1.38, -0.3); TPTS (-1.65, -0.6); TPTS (-2.5, 0.5); /* midland */ TPTS (-1.5, 0.5); TPTS (-1.5, 2.0); /* panhandle */ TPTS (-0.75, 2.0); ir = ig = ib = 0; for (i=0; i