Add OBJ file loading

This commit is contained in:
austin committed 2020-07-01 17:42:44 -07:00
1 parent b024d821f5
commit c82f690943
6 files changed
+165 -3

No files matched your search

+21
View File
@@ -0,0 +1,21 @@
#ifndef GEOMETRY_H
#include "point.h"
#include <vector>
struct Face
{
unsigned int vertIndex[3];
};
struct Mesh
{
std::vector<Point> verts;
std::vector<Face> faces;
};
#define GEOMETRY_H
#endif
+11
View File
@@ -0,0 +1,11 @@
#ifndef LOADER_H
#include "geometry.h"
int LoadMesh(char *filename, Mesh &mesh);
#define LOADER_H
#endif
+24
View File
@@ -0,0 +1,24 @@
#ifndef POINT_H
// STRUCTURE
struct Point
{
inline Point(void) : x(0), y(0), z(0), w(1) {}
inline Point(float x, float y, float z) : x(x), y(y), z(z), w(1) {}
union
{
float e[4];
struct
{
float x, y, z, w;
};
};
};
#define POINT_H
#endif