summaryrefslogtreecommitdiffstats
path: root/tests/libdimension/render.c
diff options
context:
space:
mode:
authorTavian Barnes <tavianator@gmail.com>2010-11-06 16:57:33 -0400
committerTavian Barnes <tavianator@gmail.com>2010-11-06 16:57:33 -0400
commitd7e9d913730b96a83751863ad896648488296532 (patch)
tree14d16fc53339b272fef7d33092dd5eb89da9d5e6 /tests/libdimension/render.c
parentfd741e79c56c78de91ab3cbcbeaee28eddcee2dd (diff)
downloaddimension-d7e9d913730b96a83751863ad896648488296532.tar.xz
Add pattern framework, impelement checker pattern.
Diffstat (limited to 'tests/libdimension/render.c')
-rw-r--r--tests/libdimension/render.c16
1 files changed, 10 insertions, 6 deletions
diff --git a/tests/libdimension/render.c b/tests/libdimension/render.c
index 12c0588..bc662d3 100644
--- a/tests/libdimension/render.c
+++ b/tests/libdimension/render.c
@@ -104,12 +104,6 @@ dmnsn_new_test_scene(void)
dmnsn_object *csg = dmnsn_new_csg_difference(cube, sphere);
dmnsn_array_push(scene->objects, &csg);
- dmnsn_object *plane = dmnsn_new_plane(dmnsn_new_vector(0.0, 1.0, 0.0));
- plane->trans = dmnsn_translation_matrix(dmnsn_new_vector(0.0, -2.0, 0.0));
- plane->texture = dmnsn_new_texture();
- plane->texture->pigment = dmnsn_new_solid_pigment(dmnsn_white);
- dmnsn_array_push(scene->objects, &plane);
-
dmnsn_object *cylinder = dmnsn_new_cylinder(0.1, 0.1, false);
cylinder->trans =
dmnsn_matrix_mul(
@@ -155,6 +149,16 @@ dmnsn_new_test_scene(void)
torii->texture->finish = dmnsn_new_ambient_finish(dmnsn_white);
dmnsn_array_push(scene->objects, &torii);
+ dmnsn_object *plane = dmnsn_new_plane(dmnsn_new_vector(0.0, 1.0, 0.0));
+ plane->trans = dmnsn_translation_matrix(dmnsn_new_vector(0.0, -2.0, 0.0));
+ plane->texture = dmnsn_new_texture();
+ dmnsn_pattern *checker = dmnsn_new_checker_pattern();
+ dmnsn_color_map *color_map = dmnsn_new_color_map();
+ dmnsn_add_color_map_entry(color_map, 0.5, dmnsn_black);
+ dmnsn_add_color_map_entry(color_map, 1.0, dmnsn_white);
+ plane->texture->pigment = dmnsn_new_color_map_pigment(checker, color_map);
+ dmnsn_array_push(scene->objects, &plane);
+
return scene;
}