- Home /
C# library to detect the position of physical objects on the screen
Hello Guys, I am currently looking for a C# library or solution that will allow me to locate the exact position of a physical object on the screen in my program. Below is a screenshot of how it should be calculated:
3 points A B C. The distance between A B and point C would be defined by default in the program as a pattern. However I do not know what solutions to use to recognize these points on the screen once I place an object.
Scenario: I run the program. On the tablet screen I place an object with three bases which are conductive. The program recognizes the distance between A and B and the point C relative to these two and pops up a window, that the placed object on the screen is consistent with the one defined natively in the code.
Answer by Casiell · Jan 04 at 11:24 PM
Ok, I don't fully get what you are trying to do here, but here are some things that might help you:
https://docs.unity3d.com/ScriptReference/Camera.WorldToScreenPoint.html
This will give you the position of your objects in screen coordinates.
https://docs.unity3d.com/ScriptReference/Input-touches.html
This gives you positions where your screen is being touched. It doesn't matter if it's your finger or another object, all that matters is that your tablet recognizes the touch. Of course for 3 points the hardware must actually be capable of that, but I think it's a standard in new tablets. I remember old devices were only recognizing one touch at a time
Now just check if those touch positions are close enough to your predefined points and you're done
Your answer
Follow this Question
Related Questions
Collision in between 2 objects moving away from each other? 1 Answer
Build just what's in the scene? 1 Answer
Problem with passing object to another script. 1 Answer
Why the objects in my scene are looking like silhouettes with the light button on? 1 Answer
Is there a functionality for finding how much two objects intersect each other 2 Answers