I’m doing project which has bounding box for 3d object. And actually it works well until certain point i set in object is located in front of camera. But when that point goes to the behind the camera(when z position from WorldToViewportPoint() be negative), the returned value is so werid.
Eye Gaze - SampleScene - Windows, Mac, Linux - Unity 2022.3.5f1_ DX11 2023-08-23 15-36-29.mp4 - Google Drive
(ignore the height of the boundary. I didn’t implement yet…)
It’s a sample video i take. I set the two points in the object like below image.
And in the console you can see the position of two points. (left point, right point)
And as you can see, when the z-value goes to negative, x value inverted. I have no idea what the problem is.
How can I solve this matter?