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

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

搜索

  •  

積分與排名

  • 積分 - 1818566
  • 排名 - 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>
              欧美激情成人在线| 亚洲国产精品激情在线观看| 国产精品福利网站| 亚洲在线视频| 久久久久久久综合狠狠综合| 怡红院精品视频| 欧美精品一区二区蜜臀亚洲| 在线一区免费观看| 久久久久久九九九九| 亚洲国产成人在线播放| 欧美日韩国产成人在线观看| 亚洲午夜精品久久久久久浪潮| 久久精品视频网| 91久久久一线二线三线品牌| 欧美日韩在线播放一区| 久久精品视频一| 亚洲精品乱码久久久久久黑人| 欧美一级片一区| 亚洲电影免费在线 | 午夜在线电影亚洲一区| 国产一区二区| 欧美精品久久久久久久久久| 亚洲一区在线播放| 欧美激情第10页| 香港久久久电影| 亚洲精品乱码久久久久久黑人| 国产精品久久久久久久午夜| 久久久久久穴| 在线一区二区三区四区五区| 欧美成人精精品一区二区频| 亚洲永久免费视频| 91久久一区二区| 国产日韩一区| 欧美日韩国产一级片| 久久久久久久久伊人| 一区二区三区 在线观看视频| 久久综合狠狠综合久久激情| 亚洲一区二区免费| 亚洲第一精品夜夜躁人人爽| 国产精品久久久久久久久久久久久久 | 99热这里只有精品8| 国产欧美精品国产国产专区| 欧美日韩国产bt| 久久资源在线| 久久福利毛片| 亚洲欧美综合网| 99伊人成综合| 最新中文字幕亚洲| 欧美激情视频在线播放| 久久男人资源视频| 亚洲欧美中文另类| 一本久久综合亚洲鲁鲁五月天| 亚洲二区在线视频| 尹人成人综合网| 国产一区二区丝袜高跟鞋图片| 国产精品久久国产精品99gif| 欧美激情一区二区三区不卡| 老司机67194精品线观看| 欧美一区二区视频97| 亚洲欧美自拍偷拍| 午夜国产精品视频| 亚洲一区日本| 亚洲欧美卡通另类91av | 欧美精品激情在线观看| 久久久久一区| 久久久久久久精| 久久久久www| 久久久99国产精品免费| 久久国产精品高清| 欧美在线首页| 久久久国产一区二区| 久久精品一区二区| 久久久一区二区| 久久这里有精品视频 | 欧美激情免费在线| 欧美电影免费观看高清完整版| 另类图片综合电影| 欧美成人资源网| 欧美日韩国产成人高清视频| 欧美日韩一区二区在线| 国产精品啊v在线| 国产伦精品一区二区三区| 国产亚洲欧美aaaa| 伊人精品久久久久7777| 亚洲国内精品在线| 在线综合视频| 午夜精品久久久久久久白皮肤| 久久国产精品久久久久久久久久| 久久久久国内| 亚洲电影免费观看高清完整版| 亚洲激情网站| 亚洲一二三区在线| 久久久久免费视频| 欧美激情偷拍| 国产热re99久久6国产精品| 激情欧美亚洲| 一区二区不卡在线视频 午夜欧美不卡在 | 久久综合久色欧美综合狠狠| 欧美va亚洲va香蕉在线| 亚洲精品视频在线| 午夜电影亚洲| 免费视频久久| 国产精品色午夜在线观看| 国产综合香蕉五月婷在线| 亚洲人www| 午夜国产精品视频| 免费一级欧美片在线观看| 亚洲免费观看高清完整版在线观看| 亚洲在线国产日韩欧美| 久久久综合精品| 欧美午夜理伦三级在线观看| 国产在线观看91精品一区| 亚洲精品国产视频| 欧美在线999| 亚洲人精品午夜在线观看| 亚洲欧美另类国产| 欧美精品三级| 亚洲黑丝在线| 欧美日韩国产一区二区三区| 一本大道久久精品懂色aⅴ| 日韩亚洲欧美高清| 久久精品一本| 一区二区国产在线观看| 久久久精彩视频| 国产精品丝袜91| 99国产精品国产精品久久| 久久久之久亚州精品露出| 一区二区不卡在线视频 午夜欧美不卡在| 欧美一区二区视频观看视频| 欧美三级资源在线| 亚洲国产另类精品专区| 久久激情综合| 亚洲综合视频一区| 欧美日韩国产专区| 亚洲日韩成人| 欧美成人一区二区三区| 久久9热精品视频| 国产精品永久在线| 亚洲专区免费| 99av国产精品欲麻豆| 欧美va日韩va| 亚洲电影免费观看高清| 久久久综合网站| 亚洲影院色无极综合| 欧美日韩视频在线观看一区二区三区 | 久久婷婷蜜乳一本欲蜜臀| 在线一区二区三区做爰视频网站| 美日韩精品视频免费看| 国产欧美一区二区三区视频 | 亚洲国产欧美日韩| 久久久久久久一区二区三区| 国产日韩精品久久久| 亚洲欧美怡红院| 中文国产一区| 欧美性做爰毛片| 亚洲网站在线播放| 一级成人国产| 国产精品久久久久久久久久尿| 一区二区三区视频在线观看| 亚洲国产日韩在线一区模特| 麻豆成人在线观看| 亚洲精品一区二区三区婷婷月| 欧美成人在线网站| 美脚丝袜一区二区三区在线观看| 亚洲黄色毛片| 亚洲国产欧美久久| 欧美日本久久| 亚洲午夜电影| 亚洲人成毛片在线播放| 性欧美超级视频| 国产免费成人在线视频| 亚洲一区二区在| 亚洲一区欧美| 国内揄拍国内精品久久| 久热成人在线视频| 蜜臀99久久精品久久久久久软件| 在线看日韩av| 亚洲欧洲精品一区二区三区| 欧美精品国产一区二区| 亚洲一区二区在线播放| 亚洲资源av| 狠狠色噜噜狠狠色综合久| 久久这里只有| 欧美精品综合| 香蕉精品999视频一区二区| 久久aⅴ乱码一区二区三区| 激情六月综合| 亚洲精品资源| 国产午夜精品一区理论片飘花| 久久人人爽爽爽人久久久| 乱码第一页成人| 中国女人久久久| 欧美一区二区在线播放| 亚洲国产成人久久综合一区| 99re热这里只有精品免费视频| 国产精品男gay被猛男狂揉视频| 久久久水蜜桃av免费网站| 欧美精品激情在线| 久久久精品国产99久久精品芒果| 久久尤物视频|