From: Roland Hieber Date: Wed, 13 Jan 2010 02:23:05 +0000 (+0100) Subject: tests and fixes for vector implementation X-Git-Url: https://git.rohieb.name/MicroTrace.git/commitdiff_plain/a064dd2f4e7b2a911ed46dd1499199bb4301affd?ds=inline tests and fixes for vector implementation --- diff --git a/MicroTrace.cxx b/MicroTrace.cxx index d0b1d6e..feb1eeb 100644 --- a/MicroTrace.cxx +++ b/MicroTrace.cxx @@ -1,4 +1,5 @@ #include +#include #include "Vec3f.hxx" //#include "Sphere.hxx" @@ -8,67 +9,108 @@ #include "Image.hxx" #include "PerspectiveCamera.hxx" -void RenderFrame(Camera &camera, - const std::string& fileName) -{ +void RenderFrame(Camera &camera, const std::string& fileName) { /* scene objects */ /* - Sphere s1(Vec3f(-2,1.7,0),2); - Sphere s2(Vec3f(1,-1,1),2.2); - Sphere s3(Vec3f(3,0.8,-2),2);*/ + Sphere s1(Vec3f(-2,1.7,0),2); + Sphere s2(Vec3f(1,-1,1),2.2); + Sphere s3(Vec3f(3,0.8,-2),2);*/ //InfinitePlane p1(Vec3f(0,-1,0),Vec3f(0,1,0)); /* - Triangle t1(Vec3f(-2,3.7,0),Vec3f(1,2,1),Vec3f(3,2.8,-2)); - Triangle t2(Vec3f(3,2,3),Vec3f(3,2,-3),Vec3f(-3,2,-3)); - */ - Image img(camera.resX(),camera.resY()); // image array - Ray ray; // primary ray - - for(int y=0;y