From a064dd2f4e7b2a911ed46dd1499199bb4301affd Mon Sep 17 00:00:00 2001 From: Roland Hieber Date: Wed, 13 Jan 2010 03:23:05 +0100 Subject: [PATCH] tests and fixes for vector implementation --- MicroTrace.cxx | 138 ++++++++++++++++++++++++++++++++----------------- Vec3f.cxx | 126 ++++++++++++++++++++++---------------------- Vec3f.hxx | 11 ++-- 3 files changed, 161 insertions(+), 114 deletions(-) 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