summaryrefslogtreecommitdiffstats
path: root/libdimension/canvas_pigment.c
diff options
context:
space:
mode:
authorTavian Barnes <tavianator@gmail.com>2010-04-15 00:06:22 -0400
committerTavian Barnes <tavianator@gmail.com>2010-04-15 00:06:22 -0400
commit3037c067f2937b68bfd0c7f906f7e7ecadd4b8d5 (patch)
tree1372d1f823fa665ee29a102779627464dd49dabf /libdimension/canvas_pigment.c
parent59dc3d29a1edf73cf54f10ee32d61815a437619f (diff)
downloaddimension-3037c067f2937b68bfd0c7f906f7e7ecadd4b8d5.tar.xz
Add transformations to textures and pigments.
Also, object intersection callbacks are now responsible for handling their own transformations.
Diffstat (limited to 'libdimension/canvas_pigment.c')
-rw-r--r--libdimension/canvas_pigment.c2
1 files changed, 2 insertions, 0 deletions
diff --git a/libdimension/canvas_pigment.c b/libdimension/canvas_pigment.c
index b4c6823..ad68fe1 100644
--- a/libdimension/canvas_pigment.c
+++ b/libdimension/canvas_pigment.c
@@ -40,6 +40,8 @@ dmnsn_new_canvas_pigment(dmnsn_canvas *canvas)
static dmnsn_color
dmnsn_canvas_pigment_fn(const dmnsn_pigment *pigment, dmnsn_vector v)
{
+ v = dmnsn_matrix_vector_mul(pigment->trans_inv, v);
+
dmnsn_canvas *canvas = pigment->ptr;
int x = v.x*(canvas->x - 1) + 0.5;