diff -r f6a72eb99631 -r 9d66d323c354 ccdemos/textures.cc --- a/ccdemos/textures.cc Tue Apr 29 23:31:08 2008 +0200 +++ b/ccdemos/textures.cc Fri May 02 13:27:47 2008 +0200 @@ -1,10 +1,10 @@ #include "raytracer.h" -#include "octree.h" +#include "kdtree.h" #include "common_sdl.h" -Camera cam(Vector3(0.,6.,6.), Vector3(0.,2.,-7.), Vector3(0.,0.,-1.)); -Light light(Vector3(-2.0, 10.0, -2.0), Colour(0.9, 0.9, 0.9)); +Camera cam(Vector(0.,6.,6.), Vector(0.,2.,-7.), Vector(0.,0.,-1.)); +Light light(Vector(-2.0, 10.0, -2.0), Colour(0.9, 0.9, 0.9)); Float lx, ly, lz, cf; @@ -56,7 +56,7 @@ { Raytracer rt; - Octree top; + KdTree top; rt.setCamera(&cam); rt.setTop(&top); @@ -65,12 +65,12 @@ Material mat0a(Colour(0.7, 0.7, 0.7)); mat0a.setReflectivity(0.0); - Box box(Vector3(-12.0, -1.2, -20.0), Vector3(12.0, -1.0, 0.0), &mat0a); + Box box(Vector(-12.0, -1.2, -20.0), Vector(12.0, -1.0, 0.0), &mat0a); rt.addShape(&box); Material mat0b(Colour(0.1, 0.7, 0.8)); mat0b.setReflectivity(0.7); - Box box2(Vector3(-12.0, -1.2, -10.0), Vector3(12.0, 10.0, -10.2), &mat0b); + Box box2(Vector(-12.0, -1.2, -10.0), Vector(12.0, 10.0, -10.2), &mat0b); rt.addShape(&box2); Float bounds[] = {0.3, 0.6, 1.1}; @@ -79,44 +79,44 @@ // spheres Material mat1(Colour(1.0, 1.0, 1.0)); - mat1.texture = new CheckersTexture(new PlanarMap(Vector3(-4.5, 2.0, -7.0), 0.48), &cmap); - Sphere sphere1(Vector3(-4.5, 2.0, -7.0), 1.0, &mat1); + mat1.texture = new CheckersTexture(new PlanarMap(Vector(-4.5, 2.0, -7.0), 0.48), &cmap); + Sphere sphere1(Vector(-4.5, 2.0, -7.0), 1.0, &mat1); rt.addShape(&sphere1); Material mat2(Colour(1.0, 1.0, 1.0)); - mat2.texture = new CheckersTexture(new CubicMap(Vector3(-1.5, 2.0, -7.0), 0.48), &cmap); - Sphere sphere2(Vector3(-1.5, 2.0, -7.0), 1.0, &mat2); + mat2.texture = new CheckersTexture(new CubicMap(Vector(-1.5, 2.0, -7.0), 0.48), &cmap); + Sphere sphere2(Vector(-1.5, 2.0, -7.0), 1.0, &mat2); rt.addShape(&sphere2); Material mat3(Colour(1.0, 1.0, 1.0)); - mat3.texture = new CheckersTexture(new CylinderMap(Vector3(1.5, 2.0, -7.0), 0.48), &cmap); - Sphere sphere3(Vector3(1.5, 2.0, -7.0), 1.0, &mat3); + mat3.texture = new CheckersTexture(new CylinderMap(Vector(1.5, 2.0, -7.0), 0.48), &cmap); + Sphere sphere3(Vector(1.5, 2.0, -7.0), 1.0, &mat3); rt.addShape(&sphere3); Material mat4(Colour(1.0, 1.0, 1.0)); - mat4.texture = new CheckersTexture(new SphereMap(Vector3(4.5, 2.0, -7.0), 0.48), &cmap); - Sphere sphere4(Vector3(4.5, 2.0, -7.0), 1.0, &mat4); + mat4.texture = new CheckersTexture(new SphereMap(Vector(4.5, 2.0, -7.0), 0.48), &cmap); + Sphere sphere4(Vector(4.5, 2.0, -7.0), 1.0, &mat4); rt.addShape(&sphere4); // cubes Material mat5(Colour(1.0, 1.0, 1.0)); - mat5.texture = new CheckersTexture(new PlanarMap(Vector3(-4.5, 0.0, -7.0), 0.48), &cmap); - Box cube1(Vector3(-4.5, 0.0, -7.0)-1.0, Vector3(-4.5, 0.0, -7.0)+1.0, &mat5); + mat5.texture = new CheckersTexture(new PlanarMap(Vector(-4.5, 0.0, -7.0), 0.48), &cmap); + Box cube1(Vector(-4.5, 0.0, -7.0)-1.0, Vector(-4.5, 0.0, -7.0)+1.0, &mat5); rt.addShape(&cube1); Material mat6(Colour(1.0, 1.0, 1.0)); - mat6.texture = new CheckersTexture(new CubicMap(Vector3(-1.5, 0.0, -7.0), 0.48), &cmap); - Box cube2(Vector3(-1.5, 0.0, -7.0)-1.0, Vector3(-1.5, 0.0, -7.0)+1.0, &mat6); + mat6.texture = new CheckersTexture(new CubicMap(Vector(-1.5, 0.0, -7.0), 0.48), &cmap); + Box cube2(Vector(-1.5, 0.0, -7.0)-1.0, Vector(-1.5, 0.0, -7.0)+1.0, &mat6); rt.addShape(&cube2); Material mat7(Colour(1.0, 1.0, 1.0)); - mat7.texture = new CheckersTexture(new CylinderMap(Vector3(1.5, 0.0, -7.0), 0.48), &cmap); - Box cube3(Vector3(1.5, 0.0, -7.0)-1.0, Vector3(1.5, 0.0, -7.0)+1.0, &mat7); + mat7.texture = new CheckersTexture(new CylinderMap(Vector(1.5, 0.0, -7.0), 0.48), &cmap); + Box cube3(Vector(1.5, 0.0, -7.0)-1.0, Vector(1.5, 0.0, -7.0)+1.0, &mat7); rt.addShape(&cube3); Material mat8(Colour(1.0, 1.0, 1.0)); - mat8.texture = new CheckersTexture(new SphereMap(Vector3(4.5, 0.0, -7.0), 0.48), &cmap); - Box cube4(Vector3(4.5, 0.0, -7.0)-1.0, Vector3(4.5, 0.0, -7.0)+1.0, &mat8); + mat8.texture = new CheckersTexture(new SphereMap(Vector(4.5, 0.0, -7.0), 0.48), &cmap); + Box cube4(Vector(4.5, 0.0, -7.0)-1.0, Vector(4.5, 0.0, -7.0)+1.0, &mat8); rt.addShape(&cube4); mat1.setReflectivity(0);