1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
| #include <gl/tinygl.h>
#include <stdio.h>
#include <stdbool.h>
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"
|