嗨,我对相机和模型旋转感到头疼。相机似乎正在工作,但模型上的旋转似乎被搞砸了。我想要的是模型在原地转动一点,但它似乎正在转动并围绕一个圆圈移动。这是我的代码。当我按右时,我的浮动角度不断增加 0.05f
绘图功能:
Vector3 cameraRotate = Vector3.Transform(offSetVector, Matrix.CreateRotationY(angle));
Vector3 cameraLookat = cameraPos + cameraRotate;
Matrix viewMatrix = Matrix.CreateLookAt(cameraPos , cameraLookat, Vector3.Up);
float aspect = GraphicsDevice.Viewport.AspectRatio;
Matrix projectionMatrix = Matrix.CreatePerspectiveFieldOfView(MathHelper.PiOver4, aspect, 0.1f, 200.0f);
carTypeOneMatrix = Matrix.CreateTranslation(pos) * Matrix.CreateRotationY(angle);
baseModel.Draw(carTypeOneMatrix , viewMatrix, projectionMatrix);