/* * Points demo * Demonstrates the use of points to "simulate" snow */ #include #include #ifdef WIN32 #include #endif #include /* Minimum stack space */ static USED const char *stack = "$STACK:65535"; static float random(float max) { float res = (float)rand() / (float)RAND_MAX; return res*max; } typedef struct { float x,y,z; float vel; int floorcnt; } PointRec; #define NUM_POINTS 4000 #define FLOORCNT_INIT 200 PointRec Points[NUM_POINTS]; void initPoint(int i) { Points[i].x = random(20.0f) - 10.0f; Points[i].z = random(20.0f) - 10.0f; Points[i].y = random(5.0f) + 3.0f; Points[i].vel = random(0.01f); Points[i].floorcnt = FLOORCNT_INIT; } void initPoints(void) { int i; for (i=0; i