/* * Lines demo * Demonstrates the use of Lines 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; } Line; #define NUM_LINES 4000 Line Lines[NUM_LINES]; void initLine(int i) { Lines[i].x = random(20.0f) - 10.0f; Lines[i].z = random(20.0f) - 10.0f; Lines[i].y = random(5.0f) + 3.0f; Lines[i].vel = 0.1; } void initLines(void) { int i; for (i=0; i