From 3950b4f0d2483cadf006bf2a957aeb820402503a Mon Sep 17 00:00:00 2001 From: Tavian Barnes Date: Tue, 26 Oct 2010 18:13:39 -0400 Subject: Add torii to libdimension. --- tests/libdimension/render.c | 22 ++++++++++++++++++++++ 1 file changed, 22 insertions(+) (limited to 'tests') 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; } -- cgit v1.2.3