teem | / | bin |
ilk: Composition of transformations |
Following along with a page about this method, if you want to rotate by 30 degrees, then we need to shear by -tan(30/2)=-0.26795 in X, sin(30)=0.5 in Y, and tan(30/2) in X again. However, because of my funny basis, I need to flip the sign of the Y shear. First, doing these as seperate samplings, in order to color each differently:
ilk -i init.ppm -0 u:0.5,0.5 -b pad -t shear:0,-0.26795 -bg 255 80 80 | tojpg > sh1.jpg
ilk -i init.ppm -0 u:0.5,0.5 -b pad -t shear:0,-0.26795 -bg 255 80 80 \ | ilk -0 u:0.5,0.5 -b pad -t shear:90,-0.5 -bg 80 255 80 \ | tojpg > sh2.jpg
ilk -i init.ppm -0 u:0.5,0.5 -b pad -t shear:0,-0.26795 -bg 255 80 80 \ | ilk -0 u:0.5,0.5 -b pad -t shear:90,-0.5 -bg 80 255 80 \ | ilk -0 u:0.5,0.5 -b pad -t shear:0,-0.26795 -bg 80 80 255 \ | tojpg > sh3.jpg
ilk -i init.ppm -0 u:0.5,0.5 -b pad \ -t shear:0,-0.26795 shear:90,-0.5 shear:0,-0.26795 | tojpg > sh4.jpg
ilk -i init.ppm -0 u:0.5,0.5 -b pad \ -t rotate:30 | tojpg > sh5.jpg