|
|
1.1 root 1: /************************************************************************\
2: *
3: * PAINT.H
4: *
5: \************************************************************************/
6:
7:
8:
9: /************************************************************************\
10: * SYMBOLIC CONSTANTS
11: \************************************************************************/
12:
13: #define NUMVERTICES 8 /* number of polyhedron vertices */
14: #define NUMFACETS 6 /* number of polyhedron facets */
15:
16: #define MAX_POINTS_PER_FACET 4
17:
18: #define XROT_INCREMENT (float) 0.0872 /* 5 degrees */
19: #define YROT_INCREMENT (float) 0.1744 /* 10 degrees */
20: #define ZROT_INCREMENT (float) 0.2617 /* 15 degrees */
21:
22:
23:
24: /************************************************************************\
25: * TYPEDEFs
26: \************************************************************************/
27:
28: typedef struct { LONG x, y, z; } POINT3D;
29:
30:
31:
32: /************************************************************************\
33: * GLOBAL VARIABLES
34: \************************************************************************/
35:
36: /* This particular set of vertices ("v") and facets describe a normalized
37: * cube centered about the origin. The facet list is made up of a series
38: * of indexes into the array of vertices, each describing an individual
39: * facet (eg. a polygon), and are separated by -1. Note that the facets
40: * are decribed in COUNTERCLOCKWISE order (so we can consistently find
41: * the normal to any given facet).
42: */
43: static POINT3D v[NUMVERTICES] = {{ 1, 1, 1}, { 1,-1, 1},
44: {-1,-1, 1}, {-1, 1, 1},
45: { 1, 1,-1}, { 1,-1,-1},
46: {-1,-1,-1}, {-1, 1,-1} };
47:
48:
49: static int facets[30] = { 3, 2, 1, 0, -1,
50: 4, 5, 6, 7, -1,
51: 0, 1, 5, 4, -1,
52: 6, 2, 3, 7, -1,
53: 7, 3, 0, 4, -1,
54: 5, 1, 2, 6, -1 };
55:
56: POINT3D xv[NUMVERTICES]; /* will hold the transformed points in "v" */
57:
58: float m[2][3]; /* the transformation matrix */
59:
60:
61:
62: /************************************************************************\
63: * FUNCTION PROTOTYPES
64: \************************************************************************/
65:
66: void ComputeXform (float, float, float);
67: void XformVertices (int, int);
This archive runs on limited infrastructure. Preserving old code on modern bandwidth. Automated agents are requested to crawl responsibly.