#include #include #include void gl_write_image (FILE * fp, const GLubyte * buffer, unsigned width, unsigned height, unsigned samples); void gl_write_image_png (FILE * fp, const GLubyte * buffer, unsigned width, unsigned height, unsigned samples); void init_gl(); void matrix_multiply (float * m, const float * n); void vector_multiply (float * v, const float * m); typedef struct { float m[16], p[16]; float n[6][3]; float d[6]; unsigned width; } Frustum; void gl_get_frustum (Frustum * f); int sphere_in_frustum (double x, double y, double z, double r, Frustum * f); float sphere_diameter (double x, double y, double z, double r, Frustum * f); void gl_check_error(); int polygonize (const double val[8], double isolevel, double triangles[5][3][3]); void gl_perspective (double fovy, double aspect, double zNear, double zFar); int gl_project (float objx, float objy, float objz, const float modelMatrix[16], const float projMatrix[16], const GLint viewport[4], float *winx, float *winy, float *winz); #include "parser.h"