DirectX运算矩阵
来源:互联网 发布:win10添加网络凭证 编辑:程序博客网 时间:2024/09/21 06:36
D3DXMATRIX * D3DXMatrixIdentity(D3DXMATRIX * pOut);
D3DXMATRIX* D3DXMatrixTranslation( D3DXMATRIX *pOut, FLOAT x, FLOAT y, FLOAT z);
D3DXMATRIX * D3DXMatrixRotationX( D3DXMATRIX *pOut, FLOAT Angle);D3DXMATRIX * D3DXMatrixRotationAxis( D3DXMATRIX *pOut, CONST D3DXVECTOR3 *pV, FLOAT Angle);
D3DXMATRIX * D3DXMatrixScaling( D3DXMATRIX *pOut, FLOAT sx, FLOAT sy, FLOAT sz);
D3DXMatrixIdentity创建一个单位矩阵,也就是
[ 1.00 0.00 0.00 0.00
0.00 1.00 0.00 0.00
0.00 0.00 1.00 0.00
0.00 0.00 0.00 1.00 ]
D3DXMatrixTranslation创建一个平移矩阵
D3DXMatrixTranslation(&g_translation, 1.0f, 2.0f, 3.0f);的运行结果如下
[ 1.00 0.00 0.00 0.00
0.00 1.00 0.00 0.00
0.00 0.00 1.00 0.00
1.00 2.00 3.00 1.00 ]
D3DXMatrixRotationX~Z为绕标准周旋转的矩阵
D3DXMatrixRotationAxis(&g_rotation,&vector3,D3DX_PI);绕任意向量旋转,不过别误会,那个向量还是过圆心的。。。。所以游戏中绕特定人物想旋转一般是先D3DXMatrixRotationY再加平移。
D3DXMatrixScaling生成缩放矩阵。
[x,y,z,1]
转化成矩阵
[ x y z 1
0 0 0 0
0 0 0 0
0 0 0 0 ]
//所以某个点的绕圆心的旋转就可以使用
事实上翻了下sdk,上面的函数有以下更精简的写法:
- DirectX运算矩阵
- OpenGL的矩阵运算是与DirectX相反的
- directX 数学基础-矩阵
- DirectX 9.0 (2) 矩阵
- DirectX Alpha颜色运算
- DirectX学习:D3DX矩阵函数
- DirectX 中矩阵得用法
- DirectX设置正交投影矩阵
- DirectX的常用矩阵函数
- DirectX函数学习:矩阵函数
- DirectX三维空间旋转矩阵原理
- 矩阵运算
- 矩阵运算
- 矩阵运算
- 矩阵运算
- 矩阵运算
- 矩阵运算
- 矩阵运算
- SQL连接字符串大全
- mysql分区相关
- 【转】深入浅出URL编码
- 使用SQLServer模板来写规范的SQL语句
- 页面 GB18030 编码 get 参数包含中文 服务器 乱码 java 转换编码
- DirectX运算矩阵
- Sql 中 SET NOCOUNT ON的含义与作用
- 水晶报表自定义纸张大小打印 (Crystal Report Print with custom paper size)
- 如何把数据批量插入具有Identity列的表
- 一天一个CRT函数 strcspn
- js获取下拉列表选中项的值和文本(select)以及获取单选按钮(radio)组的值和修改选中项
- 在SQL Server 事务中使用Savepoints来保存提交点
- java开发小技巧(一)
- Set ANSI_NULLS NULL和 SET QUOTED_IDENTIFIER的含义与作用