-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathobject.h
32 lines (27 loc) · 863 Bytes
/
object.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
#ifndef OBJECT
#define OBJECT
#include <ctype.h>
#include <cstring>
#include <stdio.h>
#include <GL/glut.h>
typedef struct
{
char* name; // Material name
float Ka[4],Kd[4],Ks[4],Ns; // Colors and shininess
float d; // Transparency
int map; // Texture
} mtl_t;
static int Nmtl=0;
static mtl_t* mtl=NULL;
static int linelen=0; // Length of line
static char* line=NULL; // Internal storage for line
static int CRLF(char ch);
static char* readline(FILE* f);
static char* getword(char** line);
static void readfloat(char* line,int n,float x[]);
static void readcoord(char* line,int n,float* x[],int* N,int* M);
static char* readstr(char* line,const char* skip);
static void LoadMaterial(const char* file);
static void SetMaterial(const char* name);
int LoadOBJ(const char* file);
#endif