Solar System - demo scence
Points

Functions

void points_vertex (const float x, const float y, const float z, unsigned int *pos, float points[])
 
void points_write (const char *filename, const unsigned int nVertices, const float points[])
 

Detailed Description

Function Documentation

◆ points_vertex()

void points_vertex ( const float  x,
const float  y,
const float  z,
unsigned int *  pos,
float  points[] 
)
20 {
21 points[*pos] = x;
22 points[*pos + 1] = y;
23 points[*pos + 2] = z;
24 *pos += 3;
25}

Referenced by model_cone_vertex(), model_cone_vertices(), model_cube_vertices(), model_plane_vertices(), and model_sphere_vertex().

◆ points_write()

void points_write ( const char *  filename,
const unsigned int  nVertices,
const float  points[] 
)
27 {
28 FILE *fp = fopen(filename, "w");
29 if (!fp) {
30 fprintf(stderr, "failed to open file");
31 exit(1);
32 }
33
34 fwrite(&nVertices, sizeof(unsigned int), 1, fp);
35 fwrite(points, 3 * sizeof(float), nVertices, fp);
36
37 fclose(fp);
38}

Referenced by model_cone_write(), model_cube_write(), model_plane_write(), and model_sphere_write().