Browse Source

Fix order of transforms.

pull/7402/head
Jan-Peter Zurek 4 years ago
parent
commit
9a01f13114
  1. 2
      samples/RenderDemo/Pages/Transform3DPage.axaml
  2. 7
      src/Avalonia.Visuals/Media/Transform3D.cs

2
samples/RenderDemo/Pages/Transform3DPage.axaml

@ -2,7 +2,7 @@
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
mc:Ignorable="d" d:DesignWidth="800" d:DesignHeight="450"
mc:Ignorable="d" d:DesignWidth="800" d:DesignHeight="650"
x:Class="RenderDemo.Pages.Transform3DPage">
<UserControl.Styles>
<Styles>

7
src/Avalonia.Visuals/Media/Transform3D.cs

@ -154,6 +154,13 @@ public class Transform3D : Transform
matrix44 *= Matrix4x4.CreateRotationY((float)Matrix.ToRadians(RotationY));
matrix44 *= Matrix4x4.CreateRotationZ((float)Matrix.ToRadians(RotationZ));
matrix44 *= Matrix4x4.CreateTranslation((float)CenterX, (float)CenterY, (float)CenterZ);
var perspectiveMatrix = Matrix4x4.Identity;
perspectiveMatrix.M34 = -1 / (float)50;
matrix44 *= perspectiveMatrix;
var matrix = new Matrix(
matrix44.M11,
matrix44.M12,

Loading…
Cancel
Save