Home > other >  Unity3d to obtain the relative coordinates of the mouse to click on the plane
Unity3d to obtain the relative coordinates of the mouse to click on the plane

Time:09-21

My plane to a script, width, height, the equivalent of axis x, y,
I need according to the mouse to click the plane coordinates to do some other processing, now the problem is that the
After clicking on the relative coordinates, how to get to?
Width=100, for example, height=100 cases, the middle one is (50, 50), the mouse click somewhere else how can I get it coordinates relative to the plane?
Some online said with radiographic testing, but if there is no way to get the relative coordinates, don't we come across such a
Requirements? The Internet is like no relevant information

CodePudding user response:

Relative coordinates, this problem is very good ah, your mouse point plane, must be through the screen first, also is the camera, to see your camera is vertical alignment plane or free Angle, are orthogonal or projection, can be calculated you point on the plane, and the world coordinate of the then relative do mark is not simple?
  • Related