Home > Transform attribute > Matrix Archive
Matrix Archive
Chapter 9 - 5 : SVG & Canvas Matrix Transformation
- 2008年7月23日 14:51
- Canvas | Matrix | Transform attribute
これは、SVG & Canvas で使われているMatrix Transformation をJavascript で計算して値を求めるためのツールです。そのMatrix値を使ってCanvas に描くようにしました。Matrix は、3×3ですので2Dです。3Dは4×4のマトリックスになります。
How to : & example
input value of translate(txty) ---> translate(50,40)
input value of scale(sxsy) ---> scale(2) or scale(1,-0.75)
input value of rotate(angle) ---> rotate(25)
input value of skewX(angle) ---> skew(-45)
"Get Matrix" button is to get values of Matrix Transformation
"Clear Text" button is to clear the textarea
"Draw Matrix" button is to redraw the image below
"Clear Canvas" button is to clear images which is drawn.
IEでも表示させるために Google の excanvas.js を使っていますが、excanvas.js に Matrixで描写するための setTransform 属性がないためにスクリプトを改造しています。しかし、IEでは、外側の赤い部分しか Matrix を Transform 出来ません。
- Comments: 0
- TrackBack (Close): 0
Home > Transform attribute > Matrix Archive
