From bab0824608498d1079d4e9522f3014d3d538aabe Mon Sep 17 00:00:00 2001 From: Tomasz Kramkowski Date: Fri, 27 Apr 2018 20:56:00 +0100 Subject: Implement basic model loading of FMD format. The FMD (Faqe Model Data) format is a format designed for faqe. It stores vertex, element and material information and mesh information. This patch provides the basic implementation and use of this format. This patch also implements perspective projection, depth testing and view and model matrices. An example fmd file is provided. --- fmd.h | 32 ++++++++++++++++++++++++++++++++ 1 file changed, 32 insertions(+) create mode 100644 fmd.h (limited to 'fmd.h') diff --git a/fmd.h b/fmd.h new file mode 100644 index 0000000..af562f9 --- /dev/null +++ b/fmd.h @@ -0,0 +1,32 @@ +/* + * Copyright (C) 2018 Tomasz Kramkowski + * SPDX-License-Identifier: MIT + */ +#ifndef FMD_H +#define FMD_H + +#include + +#include "gl.h" +#include "vertex.h" + +typedef GLuint tri[3]; +struct fmd { + int nverts; + struct vertex *verts; + int ntris; + tri *tris; + int nmtls; + char **mtls; + int nmeshes; + struct fmd_mesh { + int midx; + int tidx; + int tcnt; + } *meshes; +}; + +void fmd_load(struct fmd *fmd, FILE *f); +void fmd_free(struct fmd *fmd); + +#endif // FMD_H -- cgit v1.2.3-54-g00ecf