【发布时间】:2023-03-12 07:24:01
【问题描述】:
【问题讨论】:
标签: directx rotation scale mesh cube
【问题讨论】:
标签: directx rotation scale mesh cube
将网格矩阵平移到旋转/缩放中心,应用旋转/缩放,然后将矩阵平移回来。例如:
matWorld = Matrix.Identity
' Translate to rotation/scaling center
matWorld = matWorld * Matrix.Translate(0.1, 0.2, 0.3)
' Apply your rotation/scaling
matWorld = matWorld * Matrix.RotationZ(0.01)
' Translate from rotation/scaling center
matWorld = matWorld * Matrix.Translate(-0.1, -0.2, -0.3)
' Assign matWorld as world transformation matrix
device.Transform.World = matWorld
注意:以上我没有测试,所以可能存在语法问题。
【讨论】: