Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Inverse Matrix in the Demo does not work when scaling #48

Closed
Unreal852 opened this issue Jan 25, 2021 · 3 comments
Closed

Inverse Matrix in the Demo does not work when scaling #48

Unreal852 opened this issue Jan 25, 2021 · 3 comments

Comments

@Unreal852
Copy link

Unreal852 commented Jan 25, 2021

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();
@jingwood
Copy link
Owner

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

@drewnoakes
Copy link
Collaborator

Could potentially use System.Numerics.Vectors instead.

@jingwood
Copy link
Owner

jingwood commented Jan 29, 2021

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.

@jingwood jingwood added resolved and removed todo labels Jan 29, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants