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

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)在天涯 閱讀(1433) 評(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

搜索

  •  

積分與排名

  • 積分 - 1815596
  • 排名 - 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>
              久久久久国内| 欧美一区国产在线| 亚洲最新中文字幕| 美女性感视频久久久| 国产欧美日韩另类一区| 一个人看的www久久| 欧美激情久久久| 美女久久一区| 亚洲国产老妈| 欧美99在线视频观看| 久久精品亚洲精品国产欧美kt∨| 国产精品白丝jk黑袜喷水| 一区二区三区久久网| 亚洲激情电影中文字幕| 亚洲一区日韩| 国产欧美日韩一级| 久久久久久9| 久久另类ts人妖一区二区 | 日韩一级黄色大片| 亚洲国产精品一区二区久| 卡通动漫国产精品| 亚洲人屁股眼子交8| 亚洲美女av网站| 国产精品亚洲综合一区在线观看| 欧美一区二区在线免费观看| 久久不射中文字幕| 精品69视频一区二区三区| 亚洲美女诱惑| 在线视频精品| 久久亚洲综合色| 久久精品亚洲一区二区三区浴池| 狠狠色综合色区| 欧美国产在线电影| 欧美日韩精品欧美日韩精品 | 性亚洲最疯狂xxxx高清| 亚洲欧美网站| 亚洲国产视频一区二区| av成人福利| 精品成人国产| 亚洲精品自在久久| 国产欧美日韩综合一区在线播放| 美日韩免费视频| 欧美视频日韩视频| 乱人伦精品视频在线观看| 欧美精品激情在线| 欧美在线观看视频一区二区三区| 蜜桃精品一区二区三区 | 亚洲主播在线| 亚洲高清一区二区三区| 一区二区三区精品| 伊人久久成人| 夜夜精品视频一区二区| 影音先锋国产精品| 亚洲少妇最新在线视频| 在线成人国产| 亚洲伊人一本大道中文字幕| 亚洲国产另类 国产精品国产免费| 在线视频亚洲一区| 亚洲日本理论电影| 欧美一区二区在线| 中文精品99久久国产香蕉| 久久精品国产亚洲5555| 午夜精品福利视频| 欧美日韩国产999| 免费观看久久久4p| 国产精品区一区二区三区| 亚洲国产成人不卡| 国产日本精品| 亚洲午夜视频| 一区二区三区鲁丝不卡| 久久夜色精品国产亚洲aⅴ| 欧美在线黄色| 国产精品地址| 99精品久久免费看蜜臀剧情介绍| 亚洲国产经典视频| 久久国产精品毛片| 欧美在线国产精品| 国产精品盗摄一区二区三区| 亚洲片区在线| 亚洲日本免费| 欧美阿v一级看视频| 久久综合九色99| 国产欧美日韩一区二区三区在线| 99综合视频| 亚洲一区二三| 国产精品免费在线| 中文国产亚洲喷潮| 中文国产成人精品| 欧美视频在线观看一区二区| 99视频在线精品国自产拍免费观看| 欧美大片在线观看一区| 免播放器亚洲一区| 激情久久一区| 羞羞视频在线观看欧美| 欧美中文字幕在线播放| 国产日韩欧美一二三区| 午夜精品久久| 久久久五月婷婷| 今天的高清视频免费播放成人| 欧美在线播放视频| 久热精品视频在线免费观看| 在线精品国产欧美| 欧美 日韩 国产一区二区在线视频| 欧美99在线视频观看| 亚洲高清在线视频| 欧美成人精精品一区二区频| 欧美午夜宅男影院在线观看| 一区二区三区视频在线观看| 性欧美大战久久久久久久免费观看 | 老色批av在线精品| 亚洲国产精品99久久久久久久久| 久久这里只有精品视频首页| 欧美好骚综合网| 一区二区免费在线播放| 国产精品久久久久久久久果冻传媒 | 国产婷婷精品| 久久久五月婷婷| 亚洲国产一区二区视频| 亚洲视频大全| 国产午夜精品在线观看| 免费人成网站在线观看欧美高清| 91久久久国产精品| 亚洲欧美中文日韩v在线观看| 国产亚洲欧美在线| 欧美国产高清| 亚洲一区二区视频在线| 欧美成人国产一区二区| 中文精品视频一区二区在线观看| 国产精品网站在线观看| 久久综合狠狠综合久久综青草| 亚洲日本中文字幕区| 欧美专区在线| 日韩一级视频免费观看在线| 国产欧美日韩| 欧美国产一区二区| 午夜在线一区| 亚洲免费激情| 蜜桃久久av一区| 午夜亚洲伦理| 亚洲黄色尤物视频| 国产欧美日韩激情| 欧美日韩八区| 久热精品视频在线观看一区| 一本色道久久| 一区二区三区在线观看国产| 欧美日韩1区2区| 麻豆国产精品777777在线| 亚洲午夜精品在线| 亚洲国产精品传媒在线观看 | 黄网动漫久久久| 亚洲男人av电影| 亚洲黄一区二区| 久久嫩草精品久久久久| 亚洲在线成人精品| 亚洲伦伦在线| 亚洲电影免费观看高清完整版在线| 国产精品国产三级国产aⅴ入口| 麻豆freexxxx性91精品| 亚洲永久在线观看| 一本到12不卡视频在线dvd| 欧美成人精品一区二区| 久久久久国色av免费观看性色| 亚洲宅男天堂在线观看无病毒| 日韩一级黄色av| 亚洲精品网址在线观看| 亚洲国产精品久久久久久女王| 国产精品一香蕉国产线看观看| 欧美日韩亚洲视频一区| 欧美激情自拍| 欧美大片18| 欧美破处大片在线视频| 欧美h视频在线| 麻豆精品国产91久久久久久| 久久―日本道色综合久久| 久久国产精品99国产| 亚洲欧美一级二级三级| 亚洲欧美日韩视频一区| 亚洲自拍16p| 欧美一区二区三区久久精品茉莉花| 一区二区三区视频在线观看| 亚洲午夜一级| 亚洲一区二区三区免费观看| 亚洲视频香蕉人妖| 中文网丁香综合网| 亚洲一区三区电影在线观看| 亚洲一区二区三区三| 亚洲免费一在线| 亚洲欧美精品在线观看| 午夜免费在线观看精品视频| 亚洲在线观看免费| 亚洲自拍偷拍色片视频| 一区二区三区四区国产| 亚洲一区免费观看| 久久成人精品电影| 久久一区精品| 欧美区一区二| 国产日韩av在线播放| 在线日本高清免费不卡| 9l国产精品久久久久麻豆| 亚洲一区日韩|