diff options
Diffstat (limited to 'obj.h')
-rw-r--r-- | obj.h | 29 |
1 files changed, 17 insertions, 12 deletions
@@ -3,15 +3,20 @@ extern char obj_last_fname[101]; +#pragma pack(1) typedef struct { - float x, y, z; + float x, y, z, w; } ObjVertex; -typedef ObjVertex ObjNormal; typedef struct { - float u, v; + float x, y, z; +} ObjNormal; + +typedef struct +{ + float u, v, w; } ObjTexCoord; typedef struct @@ -23,23 +28,22 @@ typedef struct typedef struct { - float Ns; - float Ni; - float d; - float Tr; - int illum; + char *map_Ka; + char *map_Kd; ObjVertex Tf; ObjVertex Ka; ObjVertex Kd; ObjVertex Ks; ObjVertex Ke; - char *map_Ka; - char *map_Kd; + float Ns; + float Ni; + float d; + float Tr; + int illum; } ObjMtl; typedef struct { - char *mtllib; char *objectName; char *groupName; char *usemtl; @@ -50,6 +54,7 @@ typedef struct ObjTexCoord *TexCoordArray; ObjFace *FaceArray; unsigned nVertex, nNormal, nTexCoord, nFace; + char *mtllib; } ObjModel; /* function prototypes */ @@ -61,7 +66,7 @@ void ObjList(ObjModel *); /* once we load an .obj file, we can extract path up to last '/' to load a * mtl or texture that resides in the same folder */ -char *ObjGetPath(char *); +char *ObjGetPath(const char *); void ObjPutFaceGLCmd(const ObjModel *, const unsigned); void ObjFree(ObjModel *); |