opened
jweissman
username_0
In order to permit user interaction with the scene I'm trying to compute the inverse of the `_translatePoint()` utility function so that I can draw elements on the scene where the mouse is (at least where z=0). 

I think I'm trying to determine what input point.x and point.y might have resulted in the output that `_translatePoint` gives. 

I've actually come up with a solution by plugging the system of simultaneous equations using Wolfram Alpha:

      px = (-(ox * tx[1][1]) + (oy * tx[1][0]) - (tx[1][0] * y) + (tx[1][1] * x)) /  (tx[0][0] * tx[1][1]) + (tx[0][1] * tx[1][0]))
      py = (-(ox * tx[0][1]) - (oy * tx[0][0]) + (tx[0][0] * y) + (tx[0][1] * x)) / (tx[0][0] * tx[1][1]) + (tx[0][1] * tx[1][0]))

Where `ox`, `oy` is the origin and `tx` is your transformation matrix. But this doesn't seem to work, since the divisor (which actually looks like the determinant of the transform matrix) is always 0! 

Wondering if you have any thoughts on how I might be able to achieve this.
How to invert the _translatePoint function?
issue
closed
jweissman
username_0
issue
created
jdan
username_1
Hey @username_0, I see you closed this issue - did you figure it out?
comment
created
jweissman
username_0
Yeah, I think so -- the above equations do seem to actually invert the projection, with a small constant error (-4 or so in the y-axis of the projection.)
comment