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

C++ Programmer's Cookbook

{C++ 基礎} {C++ 高級} {C#界面,C++核心算法} {設計模式} {C#基礎}

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.

到底什么時候在左邊什么時候在右邊?


總結:

  • 五 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 夢在天涯 閱讀(1421) 評論(0)  編輯 收藏 引用 所屬分類: DirectX

公告

EMail:itech001#126.com

導航

統計

  • 隨筆 - 461
  • 文章 - 4
  • 評論 - 746
  • 引用 - 0

常用鏈接

隨筆分類

隨筆檔案

收藏夾

Blogs

c#(csharp)

C++(cpp)

Enlish

Forums(bbs)

My self

Often go

Useful Webs

Xml/Uml/html

搜索

  •  

積分與排名

  • 積分 - 1812196
  • 排名 - 5

最新評論

閱讀排行榜

青青草原综合久久大伊人导航_色综合久久天天综合_日日噜噜夜夜狠狠久久丁香五月_热久久这里只有精品
  • <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>
              浪潮色综合久久天堂| 欧美国产精品劲爆| 日韩亚洲精品在线| 久久国产精品久久久久久电车| 欧美精品aa| 国产精品主播| 亚洲国产精品悠悠久久琪琪| 一区二区三区黄色| 久久综合给合久久狠狠狠97色69| 亚洲国产精品一区在线观看不卡| 国产精品乱人伦中文| 国产精品高潮呻吟| 亚洲国产精品一区二区三区| 亚洲欧美中日韩| 欧美大片在线看| 亚洲黄一区二区| 欧美在线视频在线播放完整版免费观看 | 一本色道久久99精品综合| 亚洲影视在线播放| 欧美国产高潮xxxx1819| 欧美日韩视频在线观看一区二区三区| 国产日产欧产精品推荐色 | 亚洲精品系列| 欧美成人精品三级在线观看| 午夜视频一区二区| 欧美三日本三级少妇三99| 亚洲激精日韩激精欧美精品| 亚洲免费激情| 欧美成人亚洲| 精品成人在线视频| 午夜在线a亚洲v天堂网2018| 欧美国产成人精品| 国产美女精品视频| 久久久久久国产精品一区| 亚洲欧美久久久| 欧美日韩另类在线| 久久精品国产亚洲高清剧情介绍| 牛人盗摄一区二区三区视频| 在线播放一区| 欧美成人免费网站| 开心色5月久久精品| 亚洲欧美日韩精品久久亚洲区| 久久久久.com| 国产精品久久久久婷婷| 欧美激情自拍| 国产乱码精品一区二区三区忘忧草| 亚洲高清免费在线| 久久高清福利视频| 国产亚洲福利一区| 久久久久久久久久码影片| 欧美日韩一级片在线观看| 欧美成年人网| 伊人夜夜躁av伊人久久| 午夜精品久久一牛影视| 国产精品久久97| 亚洲片在线资源| 欧美欧美天天天天操| 亚洲一区二区三区三| 一区二区三区导航| 亚洲无限乱码一二三四麻| 亚洲国产精品悠悠久久琪琪| 精品福利av| 久久久久www| 国产伦精品一区二区三区照片91 | 久久国产精品一区二区三区| 这里只有精品电影| 性欧美大战久久久久久久久| 欧美伊人久久大香线蕉综合69| 午夜电影亚洲| 久久九九精品99国产精品| 国产日韩专区| 亚洲欧洲精品天堂一级| 亚洲欧洲在线一区| 欧美激情女人20p| 91久久久精品| 欧美另类视频在线| 一本色道久久综合亚洲91| 先锋影音国产一区| 国产一区二区久久| 久久网站热最新地址| 亚洲欧美日韩在线观看a三区| 欧美亚洲成人免费| 欧美激情一区二区三区在线 | 亚洲视频一区在线观看| 国产一区二区成人久久免费影院| 国产精品免费网站| 亚洲永久免费观看| 国产亚洲aⅴaaaaaa毛片| 久久久久久久一区| 欧美精品三区| 日韩视频在线观看国产| 欧美一二区视频| 欲香欲色天天天综合和网| 亚洲欧美日韩精品久久亚洲区| 亚洲一区二区三区高清 | 国产精品一区在线观看你懂的| 亚洲国内精品在线| 久久精品国产一区二区电影 | 国产主播一区| 国产精品日韩在线| 欧美一区二区播放| 国产午夜精品理论片a级探花| 亚洲欧美视频在线| 久久视频在线免费观看| 在线日韩视频| 亚洲国产精品一区二区尤物区 | 午夜精品久久久久久久99热浪潮 | 亚洲人精品午夜在线观看| 欧美91视频| 欧美亚洲一级片| 欧美成人精品| 午夜精品国产更新| 久久久91精品国产一区二区三区| 亚洲三级免费| 久久成人免费日本黄色| 国产精品视频自拍| 在线视频精品一区| 国内久久精品| 欧美日韩中文字幕日韩欧美| 久久综合电影一区| 欧美一区二区在线| 美女91精品| 国产精品乱人伦一区二区| 久久综合久久综合久久综合| 欧美二区不卡| 欧美精品99| 欧美国产视频日韩| 欧美久久电影| 免费欧美在线视频| 一区在线播放| 久久精品国产69国产精品亚洲| 91久久久国产精品| 狠狠色伊人亚洲综合网站色| 99pao成人国产永久免费视频| 久久婷婷人人澡人人喊人人爽| 久久久夜夜夜| 欧美超级免费视 在线| 最新成人在线| 亚洲欧美国产高清| 亚洲第一免费播放区| 午夜欧美大尺度福利影院在线看| 亚洲夜间福利| 国产欧美日韩视频一区二区三区 | 亚洲开发第一视频在线播放| 亚洲私人影院| 一本大道av伊人久久综合| 日韩网站在线看片你懂的| 一区二区高清视频在线观看| 欧美激情精品久久久久久大尺度 | 欧美激情综合五月色丁香小说| 欧美88av| 9国产精品视频| 国产精品视频免费一区| 久久久夜精品| 午夜日韩激情| 国产精品永久免费视频| 亚洲欧美日本精品| 亚洲第一天堂av| 一区精品在线播放| 亚洲一区二区欧美| 免费成人在线视频网站| 亚洲精品中文在线| 久久久久久尹人网香蕉| 欧美日韩高清区| 亚洲视频你懂的| 免费h精品视频在线播放| 亚洲一区二区三区四区在线观看 | 欧美在线在线| 免费短视频成人日韩| 99视频国产精品免费观看| 激情视频一区| 亚洲国产高潮在线观看| 亚洲国产精品成人综合| 国产亚洲综合在线| 欧美激情欧美激情在线五月| 久久精品亚洲| 久久影院午夜论| 狂野欧美激情性xxxx| 欧美成人免费在线| 欧美性做爰毛片| 国产精品视频一二| 伊人久久亚洲热| 一区二区国产精品| 在线日韩中文| 欧美日韩一区二区在线观看视频| 亚洲人午夜精品| 一本久久a久久免费精品不卡| 欧美国产极速在线| 欧美成人69av| 欧美日韩视频不卡| 久久精品免视看| 国产精品国产三级国产普通话三级 | 一区在线观看视频| 亚洲福利电影| 久久精品99国产精品酒店日本| 99精品国产福利在线观看免费| 欧美二区视频| 欧美激情在线播放| 亚洲高清在线视频| 一本久道久久综合狠狠爱|