'Android change X, Y coordinates based on Z distance
Like in title. I am writting an Android app. In camera.onTouch method I am getting two points (x1, y1 in MotionEvent.ACTION_DOWN and x2, y2 in MotionEvent.ACTION_UP) and drawing it on camera preview. How to change those coordinates based on distance double z (this is distance from camera to object not from point to point)? By changing I mean move closer those 2 points to themselves and further once I change distance. This distance is calculated with benchmark drawn on screen that we know real size and focal length of phone.
So I have x1, y1, x2, y2, z and looking for newX1, newY1, newX2, newY2.
I hope my post is understandable.
Sources
This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.
Source: Stack Overflow
| Solution | Source |
|---|
