can-it-be-done-in-react-native icon indicating copy to clipboard operation
can-it-be-done-in-react-native copied to clipboard

How to get the original coordinate after transform

Open richardcoder opened this issue 1 year ago • 1 comments

Thanks in advance for such a good transform solution and good tutorial video: https://www.youtube.com/watch?v=yBuhnVDXekQ

I apply pinch/pan gesture detectors as shown in video to enable user to zoom in/zoom out and translate a picture. It works perfectly.

In addition, I want to add a tap detector to enbale user to draw path on the canvas, which is used to allow user to select special area on the picture. However, after transformation, the coordinate of tap detector event.x and event.y also get 3D Affine Transform and the path is not drawn at where user press at.

I want to ask if there is a reverse function of multiply4 which accept the 1x3 vector and transform matrix to get the original coordinate before transformation? Or should I write by myself according to the reference material ?https://www.brainvoyager.com/bv/doc/UsersGuide/CoordsAndTransforms/SpatialTransformationMatrices.html

Thanks a lot and looking forward to your reply!

richardcoder avatar Jul 24 '23 03:07 richardcoder

I am not sure what you mean exactly, the invert matrix transformation can get you from the result vector to the original vector, not sure if this helps.

wcandillon avatar Jul 24 '23 06:07 wcandillon