c++ - DirectX 数学中 XMMatrixDecompose() 的对面?
问题描述
我正在使用该功能
bool XM_CALLCONV XMMatrixDecompose(
XMVECTOR *outScale,
XMVECTOR *outRotQuat,
XMVECTOR *outTrans,
FXMMATRIX M
);
分解视图矩阵,以便我可以通过键盘和鼠标移动对其进行修改,
XMVECTOR out_scale, out_rot_quat, out_trans;
XMMatrixDecompose(&out_scale, &out_rot_quat, &out_trans, view_matrix);
然后我需要使用 modified 组成视图矩阵out_scale, out_rot_quat, out_trans
执行此操作的等效 DirectXMath 函数是什么?没有这样的功能XMMatrixCompose
谢谢,
以下是此功能的文档 https://docs.microsoft.com/el-gr/windows/desktop/api/directxmath/nf-directxmath-xmmatrixdecompose
解决方案
XMMatrixAffineTransformation或XMMatrixTransformation。您为旋转原点值传递一个零。
XMMATRIX mat = XMMatrixAffineTransformation(out_scale,
g_XMZero,
outRotQuat,
out_trans);
有关 DirectXMath 的更多信息,请参阅GitHub。
推荐阅读
- html - 如何在windows的outlook中垂直对齐文字和图片?
- javascript - 来自服务器的 SocketIO 消息不起作用
- flutter - Dart 中的 static const 与 final 是否相等?
- c# - Xamarin 叠加视图中的椭圆形
- cypress - 如何等待在 cypress 测试中截获的特定响应数据
- terraform - 如何限制模块/服务在 terraform 中执行
- certificate - 使用 Saml 2 元数据管理翻转
- c# - 如何在 C# 中从另一个类创建对象的 ArrayList
- algorithm - 图着色恶魔算法中的解约简
- java - 一个按钮上的多个功能(actionListeners)