小编hak*_*kam的帖子

如何围绕其中心旋转3D模型?

我正在制作3D汽车游戏,我有旋转问题.我想围绕自己旋转模型,但是当我移动时,它开始在世界各地移动!

问题是:如何让模型的中心移动?

我试图改变这样的代码:

 effect.World = Matrix.CreateRotationZ(modelRotation) *  effect.World = Matrix.CreateTranslation(position); 
Run Code Online (Sandbox Code Playgroud)

现在不是相对于模型向前移动,而是朝着设定的方向移动!这是我的代码:

 effect.World = Matrix.CreateTranslation(position) * Matrix.CreateRotationZ(modelRotation); 
                effect.View = camera.View; 
                effect.Projection = camera.Projection;
Run Code Online (Sandbox Code Playgroud)

c# 3d xna

5
推荐指数
1
解决办法
3283
查看次数

标签 统计

3d ×1

c# ×1

xna ×1