Drill into View Matrix

简介:

How does DirectX build the view matrix - From MSDN

D3DXMatrixLookAtLH

Builds a left-handed, look-at matrix.

D3DXMATRIX * D3DXMatrixLookAtLH(
  D3DXMATRIX * pOut,
  CONST D3DXVECTOR3 * pEye,
  CONST D3DXVECTOR3 * pAt,
  CONST D3DXVECTOR3 * pUp
);

Parameters

pOut
[in, out] Pointer to the  D3DXMATRIX structure that is the result of the operation.
pEye
[in] Pointer to the  D3DXVECTOR3 structure that defines the eye point. This value is used in translation.
pAt
[in] Pointer to the  D3DXVECTOR3 structure that defines the camera look-at target.
pUp
[in] Pointer to the  D3DXVECTOR3 structure that defines the current world's up, usually [0, 1, 0].

Return Values

Pointer to a D3DXMATRIX structure that is a left-handed, look-at matrix.

Remarks

The return value for this function is the same value returned in the pOut parameter. In this way, the D3DXMatrixLookAtLHfunction can be used as a parameter for another function.

 

This function uses the following formula to compute the returned matrix.

zaxis = normal(At - Eye)
xaxis = normal(cross(Up, zaxis))
yaxis = cross(zaxis, xaxis)
    
 xaxis.x           yaxis.x           zaxis.x          0
 xaxis.y           yaxis.y           zaxis.y          0
 xaxis.z           yaxis.z           zaxis.z          0
-dot(xaxis, eye)  -dot(yaxis, eye)  -dot(zaxis, eye)  l
// insert material here: Introduction to 3D game programing with DirectX 9.0C
// Chapter 12-2 Implementation details
 

the eye point is uaually the equivalent to camera position


本文转自zdd博客园博客,原文链接:http://www.cnblogs.com/graphics/archive/2010/01/20/1652761.html,如需转载请自行联系原作者

相关文章
|
7月前
|
机器学习/深度学习 计算机视觉 网络架构
VGG(Visual Geometry Group)介绍
VGG(Visual Geometry Group)介绍
271 0
|
8月前
|
编解码 人工智能 数据格式
PIE-ENGINE:Modis-Aqua产品包含了L3 Mapped数据集
PIE-ENGINE:Modis-Aqua产品包含了L3 Mapped数据集
348 0
|
流计算
《Streaming Outlier Analysis for Fun and Scalability》电子版地址
Streaming Outlier Analysis for Fun and Scalability
84 0
《Streaming Outlier Analysis for Fun and Scalability》电子版地址
《Distributed End-to-End Drug Similarity Analytics and Visualization Workflow》电子版地址
Distributed End-to-End Drug Similarity Analytics and Visualization Workflow
82 0
《Distributed End-to-End Drug Similarity Analytics and Visualization Workflow》电子版地址
|
算法 数据挖掘 开发者
Measure for evaluating the goodness of a test(二)| 学习笔记
快速学习 Measure for evaluating the goodness of a test。
Measure for evaluating the goodness of a test(二)| 学习笔记
|
算法 数据挖掘 开发者
Measure for evaluating the goodness of a test(一)| 学习笔记
快速学习 Measure for evaluating the goodness of a test。
Measure for evaluating the goodness of a test(一)| 学习笔记
|
编解码 算法 数据挖掘
Density- and Grid-Based Methods|学习笔记
快速学习 Density- and Grid-Based Methods
Density- and Grid-Based Methods|学习笔记
|
数据挖掘 云计算 数据格式
跟着Cell学作图| 11.Ingenuity Pathway Analysis(IPA)
这篇2020年发表在cell上关于新冠的组学文章里面有大量的生信内容。今天带大家复现其中同一个软件(IPA)做的两张图。
782 0
跟着Cell学作图| 11.Ingenuity Pathway Analysis(IPA)
|
Java 定位技术
Google Earth Engine(GEE)——Error: Projection: The CRS of a map projection could not be parsed.(坐标转换错)
Google Earth Engine(GEE)——Error: Projection: The CRS of a map projection could not be parsed.(坐标转换错)
725 0
Google Earth Engine(GEE)——Error: Projection: The CRS of a map projection could not be parsed.(坐标转换错)
PAT (Advanced Level) Practice - 1044 Shopping in Mars(25 分)
PAT (Advanced Level) Practice - 1044 Shopping in Mars(25 分)
133 0