Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
我有行星围绕太阳旋转。太阳在中间。
我想让行星围绕太阳和它们自己的轴旋转。
我的轮换代码是:
world_.SetValue(Matrix.CreateRotationZ(-(float) ((gameTime.TotalGameTime.TotalSeconds % 100) * 2 * Math.PI / 100)));
在我看来,这很容易实现(因为我可以在 OpenGL、Android 等中做到这一点)但由于某种原因我卡住了......
你想绕着自己的轴transalate旋转行星。rotate
transalate
rotate
worldMatrix=scaleMatrix * rotateMatrix(around own axis) * translateMatrix(around the sun)