|
|
Microsoft OS/2 SDK PM 08-08-1988
/*--------------------------------------------------------*\
SSTRUCT.H - 3D shape data structures
\*--------------------------------------------------------*/
#define MAX_WINDOWS 8 /* max parent + child windows */
#define MAX_POINTS 100 /* max points per object */
#define MIN_SCALE 4 /* min scale multiplier */
/*
3D "OBJECT" Data Structure:
Each object consists of a table of 3D points, a list of lines, and/or
a list of faces. When clipping is off, the list of lines are used and when
clipping is on, the list of faces are used to draw the shape.
Each line consists of two points (indexes for the table of 3D points).
A list of lines is terminated by the line {-1,-1}.
Each face consists of a list of the points on the perimeter, and optional
lists of points for patterns which appear on the face. If the face is
visible then the perimeter is drawn along with the optional patterns.
The points for the perimeter of the face are specified in counter clockwise
order as one views the shape from the outside. Each pattern is a list of
points which are to be connected by lines.
The following values are used to terminate the lists:
-1 end of perimeter or pattern
-2 end of face (and end of perimeter or pattern)
-3 end of object
*/
typedef struct { INT x, y, z; } POINT3D;
typedef struct { INT x, y; } POINT2D;
typedef struct { INT p1, p2; } LINE;
typedef INT FACE;
typedef struct
{
INT cPoints; /* number of 3D points */
POINT3D *rgpt3; /* array of points */
LINE *rgline; /* array of lines */
FACE *rgface; /* array of faces */
}
OBJECT;
typedef struct
{
LONG zViewDist; /* viewing distance for perspective */
POINT3D pt3Angle; /* initial angle of rotation */
POINT3D pt3AngVel; /* angular velocity for rotation */
POINT3D pt3SizeMid; /* initial size */
POINT3D pt3SizeMag; /* magnitude of sinusoidal size change */
POINT3D pt3SizeAng; /* initial angle for sinusoidal size change */
POINT3D pt3SizeVel; /* angular velocity of sinusoidal size change */
}
INIT;
typedef struct
{
CHAR *szName; /* name of shape */
OBJECT *pobject; /* object definition */
INIT *pinit; /* initial parameters */
}
SHAPE;
/*
Each window (child or parent) has an associated SHAPEVARS structure.
In essence, these variables are local to the window.
*/
typedef struct
{
INT iShape; /* shape index */
HWND hwndFrame; /* Frame hwnd */
HWND hwndClient; /* Client hwnd */
HPS hpsClient; /* Client hps */
POINTL *rgptOld; /* previously drawn 2D points */
POINTL *rgptNew; /* next to be drawn 2D points */
BOOL fShaded; /* shaded flag */
BOOL fErased; /* window erased flag */
BOOL fClipping; /* clipping flag */
BOOL fVarySize; /* vary size flag */
BOOL fPerspective; /* perspective flag */
POINTL ptCentre; /* centre point in window */
LONG zViewDist; /* viewing distance (perspective) */
POINT2D pt2LightAng; /* light source angle (x/y rotations) */
POINT3D pt3Angle; /* shape's current angle of rotation */
POINT3D pt3AngVel; /* shape's angular velocity of rotation */
POINT3D pt3Size; /* current size */
POINT3D pt3SizeMid; /* middle size of sinusoidal size change */
POINT3D pt3SizeMag; /* magnitude of sinusoidal size change */
POINT3D pt3SizeAng; /* current angle for sinusoidal size change */
}
SHAPEVARS;
typedef SHAPEVARS *PSV;
This archive runs on limited infrastructure. Preserving old code on modern bandwidth. Automated agents are requested to crawl responsibly.