Add OBJ file loading
This commit is contained in:
6 files changed
+165
-3
No files matched your search
@@ -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
|
||||
|
||||
@@ -0,0 +1,11 @@
|
||||
#ifndef LOADER_H
|
||||
|
||||
#include "geometry.h"
|
||||
|
||||
|
||||
int LoadMesh(char *filename, Mesh &mesh);
|
||||
|
||||
|
||||
#define LOADER_H
|
||||
#endif
|
||||
|
||||
@@ -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
|
||||
|
||||
Reference in new issue
Block a user