青青草原综合久久大伊人导航_色综合久久天天综合_日日噜噜夜夜狠狠久久丁香五月_热久久这里只有精品

C++ Programmer's Cookbook

{C++ 基礎(chǔ)} {C++ 高級(jí)} {C#界面,C++核心算法} {設(shè)計(jì)模式} {C#基礎(chǔ)}

Managed DirectX --- Matrix&Transform(Translation and Scaling and Rotation)

  • 一 Translation

The following transformation translates the point (x, y, z) to a new point (x', y', z').

Translate 18

You can manually create a translation matrix in managed code. The following C# code example shows the source code for a function that creates a matrix to translate vertices.

						[C#]
						
private Matrix TranslateMatrix(float dx, float dy, float dz) { Matrix ret; ret = Matrix.Identity; ret.M41 = dx; ret.M42 = dy; ret.M43 = dz; return ret; }

For convenience, managed the Microsoft Direct3D supplies the Translation method.

  • 二 Scaling

The following transformation scales the point (x, y, z) by arbitrary values in the x-, y-, and z-directions to a new point (x', y', z').

Matrix scale?


  • 三?? Rotation

?

The transformations described here are for left-handed coordinate systems, and so might be different from transformation matrices that you have seen elsewhere. For more information, see 3-D Coordinate Systems.

The following transformation rotates the point (x, y, z) around the x-axis, producing a new point (x', y', z').

Matrix x rotation

The following transformation rotates the point around the y-axis.

Matrix y rotation

The following transformation rotates the point around the z-axis.

Matrix z rotation

In these example matrices, the Greek letter theta (?) stands for the angle of rotation, in radians. Angles are measured clockwise when looking along the rotation axis toward the origin.

In a managed application, use the Matrix.RotationX, Matrix.RotationY, and Matrix.RotationZ methods to create rotation matrices. The following C# code example demonstrates how the Matrix.RotationX method performs a rotation.

				[C#]
				
private Matrix MatrixRotationX(float angle) { double sin, cos; sin = Math.Sin(angle); cos = Math.Cos(angle); Matrix ret; ret.M11 = 1.0f; ret.M12 = 0.0f; ret.M13 = 0.0f; ret.M14 = 0.0f; ret.M21 = 0.0f; ret.M22 = (float)cos; ret.M23 = (float)sin; ret.M24 = 0.0f; ret.M31 = 0.0f; ret.M32 = (float)-sin; ret.M33 = (float)cos; ret.M34 = 0.0f; ret.M41 = 0.0f; ret.M42 = 0.0f; ret.M43 = 0.0f; ret.M44 = 1.0f; return ret; }

  • 四? Matrix Concatenation

One advantage of using matrices is that you can combine the effects of two or more matrices by multiplying them. This means that, to rotate a model and then translate it to some location, you do not need to apply two matrices. Instead, you multiply the rotation and translation matrices to produce a composite matrix that contains all of their effects. This process, called matrix concatenation, can be written with the following formula.

Matrix concatination

In this formula, C is the composite matrix being created, and M1 through Mn are the individual transformations that matrix C contains. In most cases, only two or three matrices are concatenated, but there is no limit.

Use the Matrix.Multiply method to perform matrix multiplication.

The order in which the matrix multiplication is performed is crucial. The preceding formula reflects the left-to-right rule of matrix concatenation. That is, the visible effects of the matrices that you use to create a composite matrix occur in left-to-right order. A typical world transformation matrix is shown in the following example. Imagine that you are creating the world transformation matrix for a stereotypical flying saucer. You would probably want to spin the flying saucer around its center - the y-axis of model space - and translate it to some other location in your scene. To accomplish this effect, you first create a rotation matrix, and then multiply it by a translation matrix, as shown in the following formula.

World Space explanation

In this formula, Ry is a matrix for rotation about the y-axis, and Tw is a translation to some position in world coordinates.

The order in which you multiply the matrices is important because, unlike multiplying two scalar values, matrix multiplication is not commutative. Multiplying the matrices in the opposite order has the visual effect of translating the flying saucer to its world space position, and then rotating it around the world origin.

No matter what type of matrix you are creating, remember the left-to-right rule to ensure that you achieve the expected effects.

到底什么時(shí)候在左邊什么時(shí)候在右邊?


總結(jié):

  • 五 3-D Transformations


In applications that work with 3-D graphics, geometrical transformations can be used to do the following.

  • Express the location of an object relative to another object.
  • Rotate and size objects.
  • Change viewing positions, directions, and perspectives.

You can transform any point (x,y,z) into another point (x', y', z') using a 4 x 4 matrix.

Matrix multiply

Perform the following operations on (x, y, z) and the matrix to produce the point (x', y', z').

Matrix expanded

The most common transformations are translation, rotation, and scaling. You can combine the matrices that produce these effects into a single matrix to calculate several transformations at once.

posted on 2006-05-09 16:10 夢(mèng)在天涯 閱讀(1421) 評(píng)論(0)  編輯 收藏 引用 所屬分類: DirectX

公告

EMail:itech001#126.com

導(dǎo)航

統(tǒng)計(jì)

  • 隨筆 - 461
  • 文章 - 4
  • 評(píng)論 - 746
  • 引用 - 0

常用鏈接

隨筆分類

隨筆檔案

收藏夾

Blogs

c#(csharp)

C++(cpp)

Enlish

Forums(bbs)

My self

Often go

Useful Webs

Xml/Uml/html

搜索

  •  

積分與排名

  • 積分 - 1812199
  • 排名 - 5

最新評(píng)論

閱讀排行榜

青青草原综合久久大伊人导航_色综合久久天天综合_日日噜噜夜夜狠狠久久丁香五月_热久久这里只有精品
  • <ins id="pjuwb"></ins>
    <blockquote id="pjuwb"><pre id="pjuwb"></pre></blockquote>
      <noscript id="pjuwb"></noscript>
            <sup id="pjuwb"><pre id="pjuwb"></pre></sup>
              <dd id="pjuwb"></dd>
              <abbr id="pjuwb"></abbr>
              亚洲人久久久| 99精品欧美一区二区三区| 亚洲人成在线影院| 一区二区三区高清在线观看| 久久久久久久999精品视频| 国产麻豆9l精品三级站| 欧美日韩一区在线观看视频| 久久色在线播放| 久久久福利视频| 免费在线日韩av| 亚洲电影免费| 久久久www成人免费无遮挡大片| 蜜桃av一区二区| 亚洲夜间福利| 欧美高清不卡| 国产亚洲精品久久久| 欧美成人精品激情在线观看| 欧美肥婆在线| 久久久久久69| 国产精品多人| 国产精品成av人在线视午夜片| 欧美激情亚洲一区| 99热这里只有成人精品国产| 亚洲一区二区三区涩| 亚洲欧美中文日韩v在线观看| 一本色道久久综合亚洲精品不 | a4yy欧美一区二区三区| 亚洲二区视频在线| 久久这里只精品最新地址| 午夜国产精品影院在线观看| 欧美成人激情视频免费观看| 欧美成人精品三级在线观看 | 欧美三区在线视频| 99re6这里只有精品| 久久aⅴ国产欧美74aaa| 一本一本久久a久久精品综合麻豆 一本一本久久a久久精品牛牛影视 | 亚洲国产精品一区二区尤物区| 一本一本久久| 亚洲精品美女91| 蘑菇福利视频一区播放| 亚洲欧美成人在线| 国产精品伦子伦免费视频| 亚洲综合清纯丝袜自拍| 亚洲欧洲一区二区在线观看| 亚洲国产精品va在线看黑人动漫| 久久国产手机看片| 美日韩免费视频| 亚洲作爱视频| 亚洲精品在线一区二区| 亚洲精品影视| 久久伊人亚洲| 在线观看欧美黄色| 极品日韩久久| 亚洲人成精品久久久久| 亚洲大胆女人| 亚洲尤物精选| 久久人人爽爽爽人久久久| 久久午夜精品一区二区| 亚洲成人资源网| 亚洲一区二区三区免费视频| 日韩视频一区二区在线观看 | 亚洲影院免费| 欧美国产另类| 欧美一区二区黄色| 亚洲乱码久久| 亚洲经典一区| 欧美中文字幕第一页| 久久成人亚洲| 亚洲国产另类精品专区| 亚洲精品一区二区三区蜜桃久| 国产女精品视频网站免费 | 在线观看欧美精品| 国产精品美女主播| 国产精品久久久久77777| 久久国产福利国产秒拍| 亚洲一区3d动漫同人无遮挡| 久久成人亚洲| 亚洲特色特黄| 久久精品亚洲一区二区三区浴池| 在线播放中文字幕一区| 欧美一区二区三区免费视频| 亚洲一区二区三区中文字幕在线 | 亚洲国产福利在线| 亚洲精品极品| 欧美天天影院| 欧美日韩国产综合久久| 久久精品视频免费| 国产精品欧美久久| 亚洲免费大片| 亚洲老司机av| 一区二区久久久久久| 久久久久久色| 久久国产精品网站| 一本久久知道综合久久| 欧美人与性禽动交情品| 国产精品久久9| 亚洲一品av免费观看| 日韩一级黄色av| 久久男女视频| 亚洲一区制服诱惑| 亚洲高清视频在线观看| 欧美成人精品高清在线播放| 欧美日韩成人一区二区| 亚洲人成毛片在线播放| 午夜精品久久久久久久白皮肤| 欧美日韩在线影院| 另类激情亚洲| 免费看黄裸体一级大秀欧美| 99在线热播精品免费99热| 99riav1国产精品视频| 欧美激情1区2区| 久久艳片www.17c.com| 亚洲欧美激情一区二区| 亚洲人午夜精品免费| 亚洲国产日韩欧美综合久久 | 欧美成人免费网站| 久久久久久亚洲综合影院红桃 | 在线观看三级视频欧美| 欧美1区2区3区| 欧美国内亚洲| 欧美精品久久久久a| 久久久久久久91| 免费成人激情视频| 欧美乱大交xxxxx| 国产精品视频一二三| 欧美激情免费观看| 欧美成人免费va影院高清| 欧美一区二区在线免费观看| 在线观看不卡| 日韩午夜电影| 久久午夜精品| 篠田优中文在线播放第一区| 亚洲电影在线| 亚洲一区二区免费| 性欧美暴力猛交另类hd| 亚洲欧洲99久久| 麻豆91精品91久久久的内涵| 亚洲天堂网站在线观看视频| 欧美在线free| 女人天堂亚洲aⅴ在线观看| 国产精品久久久久久av下载红粉| 国产精品一区二区三区四区五区| 亚洲精品一区二区三区蜜桃久| 先锋影音国产一区| 久久久精彩视频| 国产精品一区二区女厕厕| 国产日韩欧美视频在线| 在线激情影院一区| 久久精品女人的天堂av| 亚洲人成在线影院| 欧美精品激情在线观看| 9l国产精品久久久久麻豆| 久久激情视频免费观看| 久久久亚洲午夜电影| 亚洲欧美国产77777| 美女91精品| 久久综合九色99| 伊人久久噜噜噜躁狠狠躁| 欧美一区二区三区四区高清| 一区二区三区www| 国产精品久久午夜| 香蕉久久精品日日躁夜夜躁| 欧美99久久| 欧美精品一区二区三区久久久竹菊| 激情欧美一区二区三区| 狼狼综合久久久久综合网| 亚洲国产91| 狠狠色综合日日| 国产精品99久久久久久有的能看| 欧美精品久久久久久久| 免播放器亚洲一区| 亚洲精品免费观看| 性做久久久久久久久| 久久精品一本| 亚洲欧美国产毛片在线| 中文在线资源观看视频网站免费不卡| 99精品国产福利在线观看免费| 欧美日韩高清在线播放| 男人插女人欧美| 国产三级欧美三级| 蜜桃av噜噜一区| 午夜亚洲性色视频| 欧美激情一区二区三区在线| 欧美69视频| 最新成人av网站| 亚洲一区观看| 欧美精品在线一区| 亚洲伊人网站| 狂野欧美一区| 亚洲免费电影在线观看| 欧美日韩一区二区在线观看视频 | 欧美综合国产精品久久丁香| 一区二区三区视频免费在线观看 | 国产精品性做久久久久久| 亚洲第一精品夜夜躁人人躁 | 亚洲精品在线视频观看| 欧美成人精品一区| 亚洲欧美日韩在线高清直播| 亚洲一区二区三区中文字幕| 国产精品成人一区二区网站软件|