diff --git a/c3d.c b/c3d.c index c82336c..23494d2 100644 --- a/c3d.c +++ b/c3d.c @@ -490,7 +490,7 @@ int main() { bool run3d = true; if (true) { - Object3D t = ReadObjectFromFile("cube.obj"); + Object3D t = ReadObjectFromFile("mario.obj"); for (int i = 0; i < t.triangles->length; i++) { // printf("t: %f\n", t.triangles->arr[i].a.x); TriArrayAppend(&tarr, t.triangles->arr[i]); diff --git a/reader.c b/reader.c index bc60439..6bd51a7 100644 --- a/reader.c +++ b/reader.c @@ -91,7 +91,7 @@ Object3D ReadObjectFromFile(char *fname) { tarr.length = 0; CMaterialArray cmats; - cmats.arr = malloc(10 * sizeof(CMaterial)); + cmats.arr = malloc(50 * sizeof(CMaterial)); cmats.length = 0; out.triangles = &tarr; @@ -146,6 +146,11 @@ Object3D ReadObjectFromFile(char *fname) { fclose(f); printf("Loaded model %s with %d tris\n", fname, tarr.length); + + printf("Mats Loaded\n"); + for (int i = 0; i < cmats.length; i++) { + printf("%s\n", cmats.arr[i].name); + } return out; // TODO: use file object and read each line