jingwood / d2dlib

A .NET library for hardware-accelerated, high performance, immediate mode rendering via Direct2D.

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Inverse Matrix in the Demo does not work when scaling

Unreal852 opened this issue · comments

Hi, i used the Matrix3 provided in the Demo but when scaling it, the inverse matrix does not work, or maybe i'm doing it wrong . Here is how i update my matrix

Matrix.LoadIdentity();
Matrix.Scale(ViewZoom, ViewZoom);
Matrix.Translate(ViewPosition.X, ViewPosition.Y);
InverseMatrix.CopyFrom(Matrix).Inverse();

Yes I can confirm the bug, let me fix it...

Could potentially use System.Numerics.Vectors instead.

Added the scale feature, as well as new feature for drag-to-move.
image

Thanks, @drewnoakes! I haven't noticed there is a built-in numeric library. Now It has been changed to use the System.Numeric.* instead.