Continuing working on dumping the world
This commit is contained in:
@@ -38,4 +38,16 @@ Intersect Sphere::localIntersect(Ray r)
|
||||
Tuple Sphere::localNormalAt(Tuple point)
|
||||
{
|
||||
return (point - Point(0, 0, 0)).normalise();
|
||||
}
|
||||
|
||||
void Sphere::dumpMe(FILE *fp)
|
||||
{
|
||||
fprintf(fp, "\"Type\": \"Sphere\",\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, "\"radius\": { \"x\": %f, \"y\": %f, \"z\": %f}, \n",
|
||||
t.x, t.y, t.z);
|
||||
Shape::dumpMe(fp);
|
||||
}
|
||||
Reference in New Issue
Block a user