fixed bug in QuadraticSolver, cheap lighting working

git-svn-id: svn://anubis/fart/trunk@45 7f9b0f55-74a9-4bce-be96-3c2cd072584d
This commit is contained in:
Josh Holtrop committed 2009-01-23 23:56:39 +00:00
1 parent 761925220b
commit d88f1ab5fd
5 files changed
+29 -20

No files matched your search

+10 -4
View File
@@ -2,14 +2,20 @@
#include <iostream>
#include <cassert>
#include "util/Transform.h"
#include "shapes/Sphere.h"
using namespace std;
int main()
{
Transform t;
t.scale(3, 2, 1);
t.translate(-1, 2, 3);
cout << "t:" << endl << t.getMatrix();
Sphere s(1.0);
Ray ray(Vector(0, -2.5, 0), Vector(0, 1, 0));
Solver::Result res = s.intersect(ray);
for (int i = 0; i < res.numResults; i++)
{
cout << "t: " << res.results[i] << endl;
}
return 0;
}