Trying to make the dump a bit more usefull and slightly less cluttered

This commit is contained in:
Godzil
2020-03-09 17:41:11 +00:00
parent 15a861802a
commit 4e241a1871
6 changed files with 83 additions and 26 deletions

View File

@@ -214,7 +214,20 @@ void OBJFile::dumpMe(FILE * fp)
fprintf(fp, "\"Objects\": {\n");
this->baseGroup->dumpMe(fp);
fprintf(fp, "},\n");
fprintf(fp, "\"Vertices\": {\n");
for(i = 1; i < this->vertexCount + 1; i++)
{
fprintf(fp, "\"v[%d]\": { \"x\": %f, \"y\": %f, \"z\": %f },\n", i,
this->vertices(i).x, this->vertices(i).y, this->vertices(i).z);
}
fprintf(fp, "},\n");
fprintf(fp, "\"NormalVertices\": {\n");
for(i = 1; i < this->vertexNormalCount + 1; i++)
{
fprintf(fp, "\"vn[%d]\": { \"x\": %f, \"y\": %f, \"z\": %f },\n", i,
this->verticesNormal(i).x, this->verticesNormal(i).y, this->verticesNormal(i).z);
}
fprintf(fp, "},\n");
Shape::dumpMe(fp);
}