-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathobjLib.h
53 lines (35 loc) · 833 Bytes
/
objLib.h
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
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
#ifndef OBJLIB_H
#define OBJLIB_H
#define BUFFER_LENGTH 255
#define START_VERTEX_COUNT 2
#define START_FACE_COUNT 2
#define MULTIPLIER 2
#define OBJ_STARTS_COUNTING_FROM_ONE 1
struct Vertex
{
double x;
double y;
double z;
} Vertex;
typedef struct Face
{
int * fL;
} Face;
typedef struct All
{
int vSize;
int vCurrent;
int fSize;
int fCurrent;
struct Vertex * V;
struct Face * F;
struct Vertex ** Triangles;
} All;
void readFaces(struct Face * f, char * line);
void WriteVertexLine(All * all, char * line);
void WriteFaceLine(All * all, char * line);
void saveVertexesToTriangles(struct Vertex * T, int vertexNumber, struct Vertex * V);
void CreateTriangles(All * all);
All * ParseObjFile(char * fileName);
void DeleteAll(All * all);
#endif //OBJLIB_H