亚洲免费在线-亚洲免费在线播放-亚洲免费在线观看-亚洲免费在线观看视频-亚洲免费在线看-亚洲免费在线视频

AS3中變換矩陣的介紹

系統(tǒng) 2102 0

導讀:
  In this lesson, I shall introduce to you, the Matrix Class. Out of all the concepts to cover in Flex 2 and AS3, why did I choose to cover this topic? Well, believe it or not, the Matrix class has been around for quite some time now in Actionscript. If you’re really interested in the idea of 3D vector spaces in Flash/Flex, then this may be a subject that you may want to further look into. For now, we’ll keep this lesson simple and lay off the heavy mathematics that you’d normally find in a full course study of linear algebra.


在這里我將向大家試講一堂矩陣課,F(xiàn)LEX2和AS中有那么多的課題可以介紹,為什么我偏偏介紹這個話題呢?當然,無論你相信與否,舉證在AS中存在已經(jīng)很久了,如果你對FLASH &FLEX中的3D空間向量很感興趣的話,這一課也許是正是你所需要的課程,現(xiàn)在我們盡可能的保持簡單,并且放下繁重的數(shù)學知識,關于矩陣的知識你可以在線性代數(shù)中找到詳細的討論
  First things first, what is a transformation matrix? Basic answer: A transformation matrix is a shorthand way of describing the positioning, rotating, and sizing of an object. When a transformation matrix is applied to an object it will often be in a different place, orientation, and size afterwards. A transformation matrix is a 3 x 3 matrix with the following contents:


首先,首先要提到的,什么是變換舉證?基本的回答是:一個變換舉證是一種非常便捷的方式來刻畫圖像對象的位置,伸縮,旋轉(zhuǎn)。當一個變換矩陣被應用得到一個對象,通常在對于這些對象在不同的地點,方向,大小。一個變換矩陣通常是一個3*3的矩陣


  Within the Matrix Class we have read/write access to the following member variables of the Matrix Class: 在這個矩陣類里面我們可以讀寫一下的矩陣屬性
a - x scale a-代表X軸方向拉伸


b - y skew b-代表Y方向斜拉伸


c - x skew c-代表X方向斜拉伸


d - y scale d-代表Y方向拉伸


tx - x translation ( positioning along the x axis ) TX-代表X方向位移


ty - y translation ( positioning along the y axis ) TY-代表Y方向位移


  The Matrix values for u, v, and w cannot be modified and assume the values 0, 0, and 1, respectively. U,V,W不能被修改默認分別為0,0,1
  The Matrix class offers four methods to perfrom matrix transformations: Translation, Scaling, Rotation, and Skewing. 矩陣類提供了四個方法來進行對象的變換,包括Translation, Scaling, Rotation, and Skewing。下面依次講解
TRANSLATE 平移變換


Description: Moves an image tx pixels to the right and ty pixels down. 將圖像沿著X,或者Y軸平移
Syntax:
  vart_matrix : Matrix = newMatrix()
  t_matrix.translate(tx, ty )
SCALE 伸縮變換


Description: Resizes an image, multiplying the location of each pixel by sx on the x-axis and sy on the y-axis. 伸縮圖像,X,Y方向的伸縮因子分別為SX,SY
Syntax:
  vart_matrix : Matrix = newMatrix()
  t_matrix.scale(sx, sy )
ROTATION 旋轉(zhuǎn)變換


Description: Rotates an image by an angle q, which is measured in radians. 將圖像旋轉(zhuǎn)Q度(弧度)
Syntax:
  vart_matrix : Matrix = newMatrix()
  t_matrix.rotate(q )
SKEWING/SHEARING 斜拉伸


Description: Progressively slides the image in a direction parallel to the x or y axis. The b property of the Matrix object represents the tangent of the skew angle along the y axis; the c property of the Matrix object represents the tangent of the skew angle along the x axis. 將圖像沿著X,Y軸平行的方向斜拉神,
Syntax:
  vart_matrix : Matrix = newMatrix()
  t_matrix.b= b;
  t_matrix.c= c;
  To alter a matrix, you can use one or more (multiple) combinations of the above methods to transform a matrix. 要改變一個變化矩陣你可以組合使用以上的變換方法來構(gòu)造一個變換舉證
  The demo app below, illustrates the basic matrix transformation operations discussed above. Observe the translation matrix values as you modify the slider values. You may view/download the source for reference. 下面的DEMO(讀者可以到原鏈接的文章上去看)展示了如何使用這些基本的變化來進行圖像的變化
  And finally, how is this practically useful in a flex application, you might ask? One use is coding a custom effect and effect instance. Maybe you might want to implement a flip or rotation effect when transitioning off to another view. Another use may involve the need for 3D imaging. Application spaces may include anything from building-architecture, medical imaging, automotive modeling, etc. 你也許要問,有什么用呢?其中一個用處就是用來制作效果。例如旋轉(zhuǎn)啊,3D構(gòu)圖,倒影什么的,關鍵就看你的想象力了


本文轉(zhuǎn)自
http://cynergysystems.com/blogs/page/keunlee?entry=transformation_matrices_in_as3

AS3中變換矩陣的介紹


更多文章、技術交流、商務合作、聯(lián)系博主

微信掃碼或搜索:z360901061

微信掃一掃加我為好友

QQ號聯(lián)系: 360901061

您的支持是博主寫作最大的動力,如果您喜歡我的文章,感覺我的文章對您有幫助,請用微信掃描下面二維碼支持博主2元、5元、10元、20元等您想捐的金額吧,狠狠點擊下面給點支持吧,站長非常感激您!手機微信長按不能支付解決辦法:請將微信支付二維碼保存到相冊,切換到微信,然后點擊微信右上角掃一掃功能,選擇支付二維碼完成支付。

【本文對您有幫助就好】

您的支持是博主寫作最大的動力,如果您喜歡我的文章,感覺我的文章對您有幫助,請用微信掃描上面二維碼支持博主2元、5元、10元、自定義金額等您想捐的金額吧,站長會非常 感謝您的哦!!!

發(fā)表我的評論
最新評論 總共0條評論
主站蜘蛛池模板: 国产亚洲综合在线 | 在线视频久草 | 高清午夜毛片 | 99资源站 | 国产自愉怕一区二区三区 | 狠狠狠狠狠狠 | 成人亚洲欧美日韩在线观看 | 国产精品欧美在线 | 免费福利视频网 | 国产精品第7页 | 离线枕边人国语在线影视 | 中文字幕在线视频精品 | 亚洲欧美另类视频 | 亚洲综合区小说区激情区噜噜 | 国产一级久久久久久毛片 | 天天爱天天做天天爽天天躁 | 色爱综合网欧美 | 一区二区在线视频 | 亚洲国产欧美另类 | 老太婆性杂交毛片 | 久久国产免费一区二区三区 | 色资源在线 | 久久精品成人欧美大片免费 | 在线视频 国产交换 | 俄罗斯一级毛片aaaa | 国产aⅴ精品一区二区三区久久 | 欧美一级α片毛片免费观看 | 色婷婷综合欧美成人 | 狠狠干天天爽 | 国产香蕉久久 | 香蕉tv亚洲专区在线观看 | 久久香蕉国产线看观看8青草 | 激情综合婷婷亚洲图片 | 狠狠色婷婷丁香综合久久韩国 | 久久99久久精品97久久综合 | 四虎综合 | 久久久一区二区三区不卡 | 国产a不卡片精品免费观看 国产a高清 | 夜夜狠狠狠狠 | 精品黑人一区二区三区 | 视频黄在线观看 |