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

C++ Programmer's Cookbook

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

Managed Directx ---world matrix , projection matrix , view matrix

Set Up a View Matrix

(^_^,只能看到projection以后棱錐上下截面間的部分)
The three input vectors represent the following, respectively:

  1. The eye point: [0, 3, -5].???? (眼睛)
  2. The camera look-at target: the origin [0, 0, 0]. (眼睛要看的東東)
  3. The current world's up-direction: usually [0, 1, 0].?? (指出那邊是上面)

?

using ?Microsoft.DirectX.Direct3D;

Device?device?
= ? null ;?? // ?Create?rendering?device.

// ?Set?up?the?view?matrix.?A?view?matrix?can?be?defined?given?an?eye?point,
// ???a?point?to?view,?and?a?direction?for?which?way?is?up.?Here,?you?set?
// ???the?eye?five?units?back?along?the?z-axis?and?up?three?units,?view?the
// ???origin,?and?define?"up"?to?be?in?the?y-direction.

device.Transform.View?
= ?Microsoft.DirectX.Matrix.LookAtLH(
????????????????????????????
new ?Vector3( 0.0f ,? 3.0f ,? - 5.0f ),
????????????????????????????
new ?Vector3( 0.0f ,? 0.0f ,? 0.0f ),
????????????????????????????
new ?Vector3( 0.0f ,? 1.0f ,? 0.0f ));

Set Up a Projection Matrix??

(project以后得到我們能夠看到的所有:一個(gè)棱錐上下截面間的部分)

This example demonstrates how to set up the projection transformation matrix, which transforms 3-D camera or view space coordinates into 2-D screen coordinates.

See the following C# code example, the Projection transformation matrix is set to be equal to the left-handed (LH) PerspectiveFovLH matrix. Input arguments to PerspectiveFovLH are as follows.

  1. Field of view in radians: pi/4. (一般都為1/4 pi)
  2. Aspect ratio, or view-space height divided by width: 1, for a square window. (長(zhǎng)寬的比)
  3. Near clipping plane distance: 1 unit.???? (離眼睛近的點(diǎn),即棱錐的上面)
  4. Far clipping plane distance: 100 units.? (離眼睛遠(yuǎn)的點(diǎn),即棱錐的下面)

?

using?Microsoft.DirectX;

Direct3D.Device?device?
=?null;??//?Create?rendering?device.

//?For?the?projection?matrix,?you?set?up?a?perspective?transform?(which
//???transforms?geometry?from?3-D?view?space?to?2-D?viewport?space,?with
//???a?perspective?divide?making?objects?smaller?in?the?distance).?To?build
//???a?perspective?transform,?you?need?the?field?of?view?(1/4?pi?is?common),
//???the?aspect?ratio,?and?the?near?and?far?clipping?planes?(which?define?
//???the?distances?at?which?geometry?should?no?longer?be?rendered).

device.Transform.Projection?
=?Matrix.PerspectiveFovLH(
??????????????????????????????(
float)Math.PI?/?4,?1.0f,?1.0f,?100.0f?);

What Is a World Transformation?

A world transformation changes coordinates from model space, where vertices are defined relative to a model's local origin, to world space, where vertices are defined relative to an origin common to all of the objects in a scene. In essence, the world transformation places a model into the world; hence its name.

Setting Up a World Matrix

As with any other transformation, you create the world transformation by concatenating a series of transformation matrices into a single matrix that contains the sum total of their effects. In the simplest case, when a model is at the world origin and its local coordinate axes are oriented the same as world space, the world matrix is the identity matrix. More commonly, the world matrix is a combination of a translation into world space and possibly one or more rotations to turn the model as needed.

The following C# code example, from a fictitious 3-D model class written in C#, creates a world matrix that includes three rotations to orient a model and a translation to relocate it relative to its position in world space.

?

public?class?ModelClass
{
???
private?float?xPos=0;
???
private?float?yPos=0;
???
private?float?zPos=0;

???
private?float?Pitch=0;
???
private?float?Yaw=0;
???
private?float?Roll=0;

???
//Other?model?properties?and?methods
???
???
public?Matrix?MakeWorldMatrix(Matrix?worldMatrix)
???
{
??????worldMatrix.Translate(xPos,yPos,zPos);

??????Matrix?matRot?
=?Matrix.Identity;

??????matRot.RotateYawPitchRoll(Yaw,Pitch,Roll);
??????
??????worldMatrix?
=?Matrix.Multiply(matRot,?worldMatrix);

??????
return?worldMatrix;

???}

}


Note:?Direct3D uses the world and view matrices that you set to configure several internal data structures. Each time you set a new world or view matrix, the system recalculates the associated internal structures. Setting these matrices frequently—for example, thousands of times per frame—is computationally time-consuming. You can minimize the number of required calculations by concatenating your world and view matrices into a world-view matrix that you set as the world matrix, and then setting the view matrix to the identity. Keep cached copies of individual world and view matrices so that you can modify, concatenate, and reset the world matrix as needed. For clarity, Direct3D samples in this documentation rarely employ this optimization.

posted on 2006-06-09 15:07 夢(mèng)在天涯 閱讀(1601) 評(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国产精品| 亚洲人精品午夜| 久久久7777| 午夜欧美精品| 久久av在线| 久久一区视频| 欧美黑人多人双交| 欧美男人的天堂| 国产精品大片| 国产在线视频欧美一区二区三区| 国产一区二区0| 亚洲国产日韩精品| 亚洲视频欧美在线| 久久视频在线视频| 亚洲国产aⅴ天堂久久| 欧美激情一区二区三区在线| 亚洲精品视频在线观看免费| 亚洲欧美日本国产有色| 久久综合九色综合久99| 欧美视频中文字幕| 国内外成人在线| 99re热这里只有精品免费视频| 亚洲欧美精品suv| 久久综合色一综合色88| 最新日韩精品| 欧美一二三区精品| 欧美激情综合五月色丁香| 国产精品免费一区豆花| 亚洲国产精品久久| 午夜一区二区三视频在线观看 | 久久精品欧美| 欧美久久久久免费| 好看的av在线不卡观看| 亚洲影院在线观看| 亚洲国产你懂的| 久久国产精品久久久久久电车 | 亚洲狠狠丁香婷婷综合久久久| 免费不卡视频| 久久岛国电影| 欧美极品一区| 亚洲成人在线免费| 性一交一乱一区二区洋洋av| 亚洲国产精品v| 久久久伊人欧美| 国产色产综合产在线视频| 亚洲专区国产精品| 日韩天堂av| 欧美极品影院| 亚洲日本电影| 欧美国产日韩亚洲一区| 久久精品欧美日韩精品| 国产亚洲电影| 欧美制服丝袜第一页| 中日韩高清电影网| 欧美色另类天堂2015| 中文av一区二区| 日韩视频中文| 国产精品v亚洲精品v日韩精品| 99精品视频免费全部在线| 欧美黄污视频| 欧美激情1区| 一区二区日韩| 一区二区三区.www| 国产精品免费区二区三区观看| 亚洲男人影院| 亚洲欧美精品在线观看| 国产三级精品三级| 久久综合久久综合久久| 久久久天天操| 亚洲另类一区二区| 99精品福利视频| 欧美日韩在线播| 亚洲欧美在线x视频| 午夜精品久久久久久99热软件| 国产日韩欧美综合| 蜜桃av一区二区三区| 欧美sm极限捆绑bd| 亚洲性感美女99在线| 亚洲在线不卡| 在线电影国产精品| 亚洲欧洲一区二区三区在线观看| 欧美日韩精品久久久| 亚洲欧美一区二区精品久久久| 午夜天堂精品久久久久| 狠狠狠色丁香婷婷综合激情| 欧美电影免费观看高清完整版| 欧美精品久久一区| 欧美在线影院| 欧美国产综合一区二区| 午夜欧美大尺度福利影院在线看| 久久成人免费日本黄色| 亚洲精选成人| 欧美一区免费视频| 亚洲免费大片| 欧美主播一区二区三区美女 久久精品人| 国内精品99| 99国产精品久久久久久久久久 | 亚洲专区国产精品| 性刺激综合网| 亚洲精品在线一区二区| 亚洲欧美99| 亚洲欧洲一区二区三区久久| 亚洲视频在线观看网站| 亚洲成在人线av| 亚洲一区二区精品| 日韩亚洲欧美成人| 久久激情网站| 午夜一区不卡| 欧美国产精品久久| 老牛影视一区二区三区| 国产精品久久久久久av福利软件| 另类成人小视频在线| 国产精品va| 亚洲精品乱码久久久久久日本蜜臀| 国模一区二区三区| 欧美亚洲日本国产| 亚洲综合成人在线| 欧美精品久久久久a| 欧美国产精品久久| 一区二区三区自拍| 欧美在线电影| 久久九九精品99国产精品| 国产精品美腿一区在线看| 亚洲欧洲一区二区天堂久久 | 亚洲精品一区二区在线| 欧美在线视频一区| 欧美淫片网站| 国产欧美日韩综合| 亚洲欧美bt| 久久精品国产免费观看| 国产麻豆午夜三级精品| 中文在线不卡| 亚洲欧美日韩另类精品一区二区三区 | 欧美一级网站| 国产精品一区一区| 亚洲伊人伊色伊影伊综合网| 亚洲女同性videos| 国产精品久久久久久久久果冻传媒 | 国产日韩欧美在线观看| 亚洲欧美成aⅴ人在线观看| 亚洲一区二区三区视频| 欧美日韩综合在线| 亚洲一区二区在线视频 | 91久久夜色精品国产九色| 91久久精品国产91久久| 欧美国产一区二区三区激情无套| 欧美激情va永久在线播放| 91久久精品www人人做人人爽| 欧美国产日韩二区| 99热在线精品观看| 久久精品成人| 亚洲第一伊人| 欧美日韩第一区日日骚| 一区二区电影免费在线观看| 亚洲激情婷婷| 一本一本a久久| 久久裸体艺术| 午夜精品福利在线观看| 欧美日一区二区在线观看 | 国产一区二区在线观看免费| 亚洲国产影院| 你懂的成人av| 欧美在线免费观看视频| 国产一区自拍视频| 久久午夜精品一区二区| 亚洲国产婷婷综合在线精品| 一本色道久久综合亚洲精品小说| 欧美婷婷六月丁香综合色| 欧美亚洲色图校园春色| 欧美aaaaaaaa牛牛影院| 中文在线不卡| 激情欧美一区二区三区在线观看| 欧美chengren| 欧美亚洲网站| 亚洲精品免费网站| 欧美一区国产二区| 亚洲激情二区| 国产精品综合网站| 毛片av中文字幕一区二区| 亚洲天堂av图片| 亚洲电影免费观看高清| 午夜精品久久久久久| 亚洲激情av在线| 国产精品一区二区男女羞羞无遮挡| 久久免费视频在线| 亚洲综合精品| 亚洲精品国偷自产在线99热| 久久精品中文字幕免费mv| 亚洲手机成人高清视频| 亚洲高清激情| 国语精品一区| 国产欧美日韩在线视频| 欧美午夜一区二区福利视频| 欧美v日韩v国产v| 久久精品国产2020观看福利| 亚洲少妇诱惑| 夜夜夜久久久| 亚洲精品一二三区| 亚洲国产精品成人久久综合一区| 久久久久久久成人|