touch convert into world coordinate
ganico opened this issue · 2 comments
ganico commented
Is there a way to convert the touch detected in MonoscopicView (i'm using video360 sample) into world coordinate where you could get a x,y and z. Similar to this kind of computation:
ADDITIONAL: when I tried logging the event.getX() & event.getY() the coordinate is not consistent.. like when you try to move the device left or right the event.getX() will give a different value already..
sigmaxipi commented
I haven't tried it, but I think the flow would be something like:
- Calculate X & Y in pixels from the center of the rendered view.
- Calculate horizontal & vertical angles of the touch from the camera viewpoint based on these X & Y.
- If the user was always facing forward, then these angles would map to the point of the sphere where they were touching the screen. But since the user is rotating the phone, you need to modify this touchpoint by applying the inverse of viewMatrix.
ganico commented
@sigmaxipi thank you for your response but i'm not 100% familiar with this computation actually.. I'm actually using my own instinct to solve this problem BWOHOHOHO!!! anyway still thanks for your response.. I got some idea about it.