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

C++ Programmer's Cookbook

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

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以后得到我們能夠看到的所有:一個棱錐上下截面間的部分)

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. (長寬的比)
  3. Near clipping plane distance: 1 unit.???? (離眼睛近的點,即棱錐的上面)
  4. Far clipping plane distance: 100 units.? (離眼睛遠的點,即棱錐的下面)

?

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

搜索

  •  

積分與排名

  • 積分 - 1812202
  • 排名 - 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>
              亚洲欧美精品| 欧美午夜久久| 久久免费视频观看| 伊甸园精品99久久久久久| 欧美大片第1页| 亚洲小视频在线| 国产精品久久久久一区二区三区共 | 亚洲激情影院| 欧美日韩久久| 亚洲深夜福利视频| 亚洲欧美影音先锋| 亚洲国产视频a| 久久久久久久久久久久久女国产乱| 亚洲免费在线视频| 亚洲一区二区在线播放| 国产原创一区二区| 麻豆av福利av久久av| 国产精品久久久久高潮| 久久一区二区三区四区| 欧美mv日韩mv国产网站| 欧美一区二区三区日韩| 午夜亚洲福利| 激情成人亚洲| 国产精品有限公司| 欧美日韩精品三区| 久久久国产精品一区二区中文 | 免费高清在线一区| 校园春色综合网| 媚黑女一区二区| 精品动漫3d一区二区三区免费| 亚洲人精品午夜| 日韩写真视频在线观看| 亚洲欧洲在线视频| 日韩视频在线观看免费| 国精产品99永久一区一区| 小处雏高清一区二区三区| 亚洲深夜福利视频| 国产午夜精品久久久久久免费视 | 欧美在线播放| 另类人畜视频在线| 亚洲国产综合在线看不卡| 性亚洲最疯狂xxxx高清| 亚洲国产精品久久久久久女王| 久久深夜福利免费观看| 夜夜嗨av色综合久久久综合网| 欧美在线精品免播放器视频| 在线观看欧美黄色| 亚洲黄色视屏| 在线观看一区| 久久夜色精品国产欧美乱极品| 午夜精品亚洲| 嫩草国产精品入口| 欧美成人免费观看| 欧美日韩在线另类| 男女激情久久| 亚洲欧美激情一区| 亚洲国产午夜| 免费不卡中文字幕视频| 亚洲一区日韩在线| 国产一区二区三区自拍| 欧美日韩成人在线播放| 欧美久久成人| 亚洲一区二区三区三| 美女在线一区二区| 欧美激情精品久久久久久| 欧美精品亚洲精品| 国产乱子伦一区二区三区国色天香 | 欧美日韩精品免费观看视一区二区 | 免费观看在线综合| 欧美在线国产| 欧美sm视频| 一本在线高清不卡dvd | 亚洲电影自拍| 蜜桃视频一区| 久久人人爽人人爽爽久久| 久久综合色一综合色88| 欧美性猛交xxxx免费看久久久| 免费亚洲视频| 欧美日韩国产123区| 欧美日韩激情网| 亚洲国产黄色片| 日韩视频永久免费观看| 亚洲国产cao| 亚洲视频一起| 在线一区二区三区四区| 亚洲午夜精品一区二区| 一二美女精品欧洲| 欧美精品一区二区三区一线天视频 | 欧美国产大片| 亚洲一区二区三区在线| 免费久久99精品国产自在现线| 午夜激情一区| 国产精品一区毛片| 久久综合伊人77777蜜臀| 亚洲视频综合| 欧美性猛交视频| 亚洲电影观看| 欧美成人综合网站| 狠狠久久亚洲欧美专区| 日韩一级片网址| 国产主播一区二区三区| 午夜精品一区二区三区电影天堂| 亚洲大片在线观看| 国产精品乱人伦中文| 久久这里只有| 亚洲欧美伊人| 精品av久久久久电影| 欧美激情一区二区久久久| 久久性色av| 亚洲精品在线观看免费| 最新国产乱人伦偷精品免费网站| 欧美伦理影院| 亚洲免费视频在线观看| 欧美大胆成人| 小辣椒精品导航| 欧美一级视频| 亚洲精品一区二区三区四区高清| 99视频精品全部免费在线| 精品成人乱色一区二区| 老司机精品福利视频| 国产精品爱啪在线线免费观看| 你懂的亚洲视频| 亚洲精品欧洲精品| 亚洲影院色无极综合| 亚洲人体偷拍| 亚洲欧美中文在线视频| 欧美在线你懂的| 欧美日韩免费观看一区二区三区| 欧美影院在线播放| 国产精品久久久久aaaa樱花| 亚洲国产中文字幕在线观看| 国产精品网站在线观看| 欧美黑人国产人伦爽爽爽| 亚洲国产精品成人一区二区| 精久久久久久| 亚洲永久免费av| 久久精品国产免费| 亚洲一区二区日本| 伊人夜夜躁av伊人久久| 欧美日韩日本国产亚洲在线| 一区二区三区四区国产精品| 在线观看日韩av电影| 久久精品国产99国产精品| 欧美大片网址| 亚洲第一福利视频| 免费试看一区| 久久国产精品久久w女人spa| 亚洲国产日本| 国产精品丝袜久久久久久app| 久久永久免费| 亚洲社区在线观看| 麻豆精品在线观看| 亚洲专区免费| 亚洲图片自拍偷拍| 国产欧美一区视频| 亚洲女爱视频在线| 99成人精品| 亚洲国产精选| 欧美在线观看视频在线| 在线观看三级视频欧美| 欧美国产日韩亚洲一区| 老色鬼久久亚洲一区二区| 亚洲视频网在线直播| 久久久久久久久久久成人| 国产亚洲欧美在线| 欧美日韩精品一区二区天天拍小说 | 欧美一区二区在线看| 亚洲福利视频网站| 欧美成人免费全部| 欧美精品成人| 欧美日韩卡一卡二| 久久久久一区二区三区四区| 亚洲高清精品中出| 久久国产精品久久久久久电车| 亚洲午夜国产成人av电影男同| 午夜影视日本亚洲欧洲精品| 一区二区三区高清在线观看| 亚洲国产欧美一区二区三区久久| 99re66热这里只有精品4| 一区二区三区精品视频| 午夜久久黄色| 亚洲精品欧美一区二区三区| 亚洲欧美一区二区视频| 欧美日韩一区二区三区四区在线观看| 国产精品久久久久久亚洲调教| 亚洲欧美综合国产精品一区| 两个人的视频www国产精品| 亚洲综合电影| 伊人夜夜躁av伊人久久| 欧美午夜剧场| 久久久亚洲人| 一本久道久久综合中文字幕| 你懂的国产精品永久在线| 午夜视频一区二区| 夜夜嗨av色综合久久久综合网| 樱桃成人精品视频在线播放| 国产精品xvideos88| 噜噜噜噜噜久久久久久91| 午夜精品国产更新| 亚洲午夜高清视频|