Continuing working on dumping the world
This commit is contained in:
@@ -73,4 +73,16 @@ Tuple Cube::localNormalAt(Tuple point)
|
||||
}
|
||||
|
||||
return Vector(0, 0, point.z);
|
||||
}
|
||||
|
||||
void Cube::dumpMe(FILE *fp)
|
||||
{
|
||||
fprintf(fp, "\"Type\": \"Cube\",\n");
|
||||
Tuple t = this->transformMatrix * Point(0, 0, 0);
|
||||
fprintf(fp, "\"center\": { \"x\": %f, \"y\": %f, \"z\": %f}, \n",
|
||||
t.x, t.y, t.z);
|
||||
t = this->transformMatrix * Point(1, 1, 1);
|
||||
fprintf(fp, "\"corner\": { \"x\": %f, \"y\": %f, \"z\": %f}, \n",
|
||||
t.x, t.y, t.z);
|
||||
Shape::dumpMe(fp);
|
||||
}
|
||||
Reference in New Issue
Block a user