summaryrefslogtreecommitdiffstats
path: root/tests/raytracexx.cpp
diff options
context:
space:
mode:
authorTavian Barnes <tavianator@gmail.com>2009-07-07 04:23:05 +0000
committerTavian Barnes <tavianator@gmail.com>2009-07-07 04:23:05 +0000
commit81c84a38992ce8e38106d86ce85ac3e88ed91a31 (patch)
tree08fb5913e141b7e208737b799b45921d477d45cc /tests/raytracexx.cpp
parentd7b7b4b3391cf99ca63d8311eac3957df7a862ed (diff)
downloaddimension-81c84a38992ce8e38106d86ce85ac3e88ed91a31.tar.xz
Add shallow copy semantics to Camera's, Object's, and Scene's.
Diffstat (limited to 'tests/raytracexx.cpp')
-rw-r--r--tests/raytracexx.cpp31
1 files changed, 2 insertions, 29 deletions
diff --git a/tests/raytracexx.cpp b/tests/raytracexx.cpp
index c04e525..4202347 100644
--- a/tests/raytracexx.cpp
+++ b/tests/raytracexx.cpp
@@ -28,34 +28,7 @@ main() {
// Set the resilience low for tests
resilience(SEVERITY_LOW);
- // Background color
- Color background = sRGB(0.0, 0.1, 0.25);
- background.filter(0.1);
-
- // Canvas
- Canvas canvas(768, 480);
-
- // Camera
- Perspective_Camera camera(
- Matrix::rotation(Vector(0.0, 1.0, 0.0))
- * Matrix::translation(Vector(0.0, 0.0, -4.0))
- * Matrix::scale(
- Vector(static_cast<double>(canvas.width())/canvas.height(), 1.0, 1.0)
- )
- );
-
- // Scene
- Scene scene(background, camera, canvas);
-
- // Objects in scene
-
- Sphere sphere;
- sphere.trans(inverse(Matrix::scale(Vector(1.25, 1.25, 1.25))));
- scene.push_object(sphere);
-
- Cube cube;
- cube.trans(inverse(Matrix::rotation(Vector(0.75, 0.0, 0.0))));
- scene.push_object(cube);
+ Scene scene = default_scene();
// Render the scene
{
@@ -66,7 +39,7 @@ main() {
// Write the canvas
std::ofstream file("raytracexx.png");
- PNG_Writer writer(canvas, file);
+ PNG_Writer writer(scene.canvas(), file);
Progress progress = writer.write_async();
std::cout << "Writing PNG file: " << progress << std::endl;