22 lines
521 B
C
22 lines
521 B
C
#include "worldgen.h"
|
|
#include <cglm/struct.h>
|
|
|
|
#define ORDER 1
|
|
#define RSQRT5 0.4472135954999579
|
|
#define TWICE_RSQRT5 = 0.8944271909999159
|
|
|
|
worldMesh generateWorld(vec3s position)
|
|
{
|
|
// placeholder struct for world mesh
|
|
worldMesh mesh;
|
|
vertex.count = 20 * ORDER * 3; // Icosahedron has 20 triangular sides
|
|
|
|
mesh.vertices = (GLfloat*) malloc(sizeof(GLfloat) * mesh.count);
|
|
populateIcosphere(mesh, ORDER, 1);
|
|
}
|
|
|
|
void populateIcosphere(worldMesh mesh, unsigned char order, float radius)
|
|
{
|
|
|
|
}
|