summaryrefslogtreecommitdiffstats
path: root/tests
diff options
context:
space:
mode:
authorTavian Barnes <tavianator@gmail.com>2010-10-26 18:13:39 -0400
committerTavian Barnes <tavianator@gmail.com>2010-10-26 18:15:02 -0400
commit3950b4f0d2483cadf006bf2a957aeb820402503a (patch)
treef7157cdada7ec7b9271967c00b0bb8cddee9bc26 /tests
parent0075e0c37d9c33ed00e4308e6444b61b204327ba (diff)
downloaddimension-3950b4f0d2483cadf006bf2a957aeb820402503a.tar.xz
Add torii to libdimension.
Diffstat (limited to 'tests')
-rw-r--r--tests/libdimension/render.c22
1 files changed, 22 insertions, 0 deletions
diff --git a/tests/libdimension/render.c b/tests/libdimension/render.c
index 49db5ae..12c0588 100644
--- a/tests/libdimension/render.c
+++ b/tests/libdimension/render.c
@@ -133,6 +133,28 @@ dmnsn_new_test_scene(void)
cone->texture->pigment = dmnsn_new_solid_pigment(dmnsn_red);
dmnsn_array_push(scene->objects, &cone);
+ dmnsn_array *torus_array = dmnsn_new_array(sizeof(dmnsn_object *));
+
+ dmnsn_object *torus1 = dmnsn_new_torus(0.15, 0.05);
+ torus1->trans = dmnsn_translation_matrix(dmnsn_new_vector(0.0, -1.0, 0.0));
+ dmnsn_array_push(torus_array, &torus1);
+
+ dmnsn_object *torus2 = dmnsn_new_torus(0.15, 0.05);
+ dmnsn_array_push(torus_array, &torus2);
+
+ dmnsn_object *torus3 = dmnsn_new_torus(0.15, 0.05);
+ torus3->trans = dmnsn_translation_matrix(dmnsn_new_vector(0.0, 1.0, 0.0));
+ dmnsn_array_push(torus_array, &torus3);
+
+ dmnsn_object *torii = dmnsn_new_csg_union(torus_array);
+ torii->trans = dmnsn_rotation_matrix(
+ dmnsn_new_vector(dmnsn_radians(-45.0), 0.0, 0.0)
+ );
+ torii->texture = dmnsn_new_texture();
+ torii->texture->pigment = dmnsn_new_solid_pigment(dmnsn_blue);
+ torii->texture->finish = dmnsn_new_ambient_finish(dmnsn_white);
+ dmnsn_array_push(scene->objects, &torii);
+
return scene;
}