ccdemos/spheres_shadow.cc
branchpyrit
changeset 19 4e0955fca797
parent 16 20bceb605f48
child 20 f22952603f29
--- a/ccdemos/spheres_shadow.cc	Mon Nov 26 17:31:37 2007 +0100
+++ b/ccdemos/spheres_shadow.cc	Mon Nov 26 23:12:40 2007 +0100
@@ -6,10 +6,10 @@
 	Raytracer rt;
 	rt.setThreads(1);
 
-	Light light1(Vector3(0.0, 5.0, 5.0), Colour(0.7, 0.3, 0.6));
+	Light light1(Vector3(0.0, 5.0, -5.0), Colour(0.7, 0.3, 0.6));
 	rt.addlight(&light1);
 
-	Light light2(Vector3(-2.0, 10.0, 2.0), Colour(0.4, 0.6, 0.3));
+	Light light2(Vector3(-2.0, 10.0, -2.0), Colour(0.4, 0.6, 0.3));
 	rt.addlight(&light2);
 
 	Material mat0(Colour(0.7, 0.7, 0.7));
@@ -18,17 +18,21 @@
 	rt.addshape(&box);
 
 	Material mat1(Colour(1.0, 0.0, 0.0));
-	Sphere bigsphere(Vector3(3.0, 2.0, 7.0), 3.0, &mat1);
+	Sphere bigsphere(Vector3(3.0, 2.0, -7.0), 3.0, &mat1);
 	rt.addshape(&bigsphere);
 
 	Material mat2(Colour(0.0, 1.0, 0.0));
-	Sphere smallsphere(Vector3(-5.5, 1.5, 8.0), 2.0, &mat2);
+	Sphere smallsphere(Vector3(-5.5, 1.5, -8.0), 2.0, &mat2);
 	rt.addshape(&smallsphere);
 
 	Material mat3(Colour(0.0, 0.0, 1.0));
-	Sphere tinysphere(Vector3(-1.2, 0.0, 2.0), 0.5, &mat3);
+	Sphere tinysphere(Vector3(-1.2, 0.0, -2.0), 0.5, &mat3);
 	rt.addshape(&tinysphere);
 
+	Camera cam;
+	cam.setEye(Vector3(0,0,15));
+	rt.setCamera(&cam);
+
 	int w = 800;
 	int h = 600;
 	float *fdata = rt.render(w, h);