【发布时间】:2014-02-17 12:32:51
【问题描述】:
我有一个汽车模型,车身是分开的,4 个轮胎是分开的,但它们在同一个 FBX 文件中。我可以旋转车身及其工作,但轮胎不会绕自己的轴旋转。
foreach (BasicEffect effect in carModel.Meshes[0].Effects)
{
effect.EnableDefaultLighting();
effect.World = transforms[carModel.Meshes[0].ParentBone.Index] * carWorldMatrix;
effect.Projection = camera.projectionMatrix;
effect.View = camera.viewMatrix;
}
carModel.Meshes[0].Draw();
foreach (BasicEffect effect in carModel.Meshes[1].Effects)
{
effect.EnableDefaultLighting();
effect.World = transforms[carModel.Meshes[1].ParentBone.Index] * tireMatrix;
effect.Projection = camera.projectionMatrix;
effect.View = camera.viewMatrix;
}
carModel.Meshes[1].Draw();
要创建旋转,我只是使用 Matrix.CreateRotationY(amount)。我怎样才能在自己的轴上旋转轮子。我现在只是在测试 1 个轮子,并不是所有的轮子
【问题讨论】:
标签: matrix xna rotation local axis