第3.6节 转换函数


我们总结了DirectX Math相关的转换函数供参考。

// Constructs a scaling matrix:构造一个缩放矩阵:
XMMATRIX XM_CALLCONV XMMatrixScaling(float ScaleX,float ScaleY,float ScaleZ); // Scaling factors缩放因子
// Constructs a scaling matrix from components invector:从组件invector构造一个缩放矩阵:
XMMATRIX XM_CALLCONV XMMatrixScalingFromVector(FXMVECTOR Scale); // Scaling factors (sx, sy,sz)缩放因子向量
// Constructs a x-axis rotation matrix Rx:构造绕一个x轴旋转矩阵Rx:
XMMATRIX XM_CALLCONV XMMatrixRotationX(float Angle); // Clockwise angle θ torotate顺时针角度θ旋转
// Constructs a y-axis rotation matrix Ry:构造绕一个y轴旋转矩阵Rx:
XMMATRIX XM_CALLCONV XMMatrixRotationY(float Angle); // Clockwise angle θ torotate顺时针角度θ旋转
// Constructs a z-axis rotation matrix Rz:构造绕一个z轴旋转矩阵Rx:
XMMATRIX XM_CALLCONV XMMatrixRotationZ(float Angle); // Clockwise angle θ torotate顺时针角度θ旋转
// Constructs an arbitrary axis rotation matrix Rn:构造绕任意轴旋转矩阵Rn:
XMMATRIX XM_CALLCONV XMMatrixRotationAxis(
FXMVECTOR Axis, // Axis n to rotate about绕轴n旋转
float Angle); // Clockwise angle θ to rotate顺时针角度θ旋转
Constructs a translation matrix:构造一个转置矩阵:
XMMATRIX XM_CALLCONV XMMatrixTranslation(float OffsetX,float OffsetY,float OffsetZ); // Translation factors
Constructs a translation matrix from components in a vector:从矢量中的组件构造一个转换矩阵:
XMMATRIX XM_CALLCONV XMMatrixTranslationFromVector(
FXMVECTOR Offset); // Translation factors (tx,ty, tz)
// Computes the vector-matrix product vM where vw = 1 for transforming points:计算矢量矩阵乘积vM,其中vw = 1用于变换点:
XMVECTOR XM_CALLCONV XMVector3TransformCoord(
FXMVECTOR V, // Input v
CXMMATRIX M); // Input M
// Computes the vector-matrix product vM where vw = 0 for transforming vectors:计算矢量矩阵乘积vM,其中vw = 0用于变换矢量:
XMVECTOR XM_CALLCONV XMVector3TransformNormal(
FXMVECTOR V, // Input v

CXMMATRIX M); // Input M

对于最后两个函数XMVector3TransformCoord和XMVector3TransformNormal,您不需要明确设置w坐标。 对于XMVector3TransformCoord和XMVector3TransformNormal,函数总是分别使用vw = 1和vw = 0。

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值