私は初心者なので、基本的なレベルで混乱している可能性がありますが、次の 2 つの Draw() ルーチンで同じ結果が得られるようで、違いはあるのでしょうか?
1 つはワールド マトリックスに変換を適用し、もう 1 つはビュー マトリックスに変換を適用します。結果はまったく同じだと思いますが、100%確信はありません。
protected override void Draw(GameTime gameTime)
{
GraphicsDevice.Clear(Color.CornflowerBlue);
Matrix worldMatrix =
Matrix.CreateTranslation(view.Position.X, view.Position.Y, view.Position.Z) *
Matrix.CreateRotationX(view.Rotation.X) *
Matrix.CreateRotationY(view.Rotation.Y) *
Matrix.CreateRotationZ(view.Rotation.Z);
Matrix viewMatrix = Matrix.CreateLookAt(view.CameraPosition, view.CameraTarget, view.CameraUp);
Matrix projectionMatrix = Matrix.CreatePerspectiveFieldOfView(view.FieldOfView,
GraphicsDevice.Viewport.AspectRatio,
view.NearPlane,
view.FarPlane);
DrawModels(worldMatrix, viewMatrix, projectionMatrix);
base.Draw(gameTime);
}
それはどのように違うのですか:
protected override void Draw(GameTime gameTime)
{
GraphicsDevice.Clear(Color.CornflowerBlue);
Matrix worldMatrix = Matrix.Identity;
Matrix viewMatrix =
Matrix.CreateTranslation(view.Position.X, view.Position.Y, view.Position.Z) *
Matrix.CreateRotationX(view.Rotation.X) *
Matrix.CreateRotationY(view.Rotation.Y) *
Matrix.CreateRotationZ(view.Rotation.Z) *
Matrix.CreateLookAt(view.CameraPosition, view.CameraTarget, view.CameraUp);
Matrix projectionMatrix = Matrix.CreatePerspectiveFieldOfView(view.FieldOfView,
GraphicsDevice.Viewport.AspectRatio,
view.NearPlane,
view.FarPlane);
DrawModels(worldMatrix, viewMatrix, projectionMatrix);
base.Draw(gameTime);
}