Thursday, November 20, 2014 transform

Transform Rectangle with 3x3 Matrix

Transforming rectangle with matrix experiments.

1) Translation

  1. At first, draw red rectangle at center(0,0).
  2. Next, translate to (100,100) and fill it as green color.

2) Scale

  1. At first, draw red rectangle at center(0,0).
  2. Next, scale up to twice and translate to (100,100) and fill it as green color.

3) Rotation

  1. At first, draw red rectangle at center(0,0).
  2. Next, rotate 30 degree and translate to (100,100) and fill it as green color.

4) Translation x Scale x Rotation

Let me try matrix multiplex experiments.

適用したい変換順とは逆順に(左にプレする)かける必要がある点に注意.

  1. At first, draw red rectangle at center(0,0).
  2. Next, prepare 3 matrixes , rotation / scale / translation.
  3. And then multiplex these 3 matrixes.
  4. At last, transform centered rectangle using this multiplexed matrix.