How to determine the topmost object in a 2D projection of a 3D object?

I have a surface on which a set of three-dimensional objects is drawn. The task is to determine the object by the given coordinates on the surface.

For example: some objects are drawn on a desktop application, I need to determine which object the user clicked on.

Could you advise how such tasks are usually solved? Do I need to create remember the topmost object for each pixel? I do not think this is the best approach.

Any thoughts are welcome!

Thank!

+3
source share
2 answers

( Google ). :

  • Ray-casting: , . ( " " " finger" .) 3D- API : Camera.ViewportPointToRay Unity3D, , , , . . ? , .

  • : , , , , . , (, ), . ( GL_SELECT OpenGL: . " " .

+2

- , , 3D, , , , .

, , , , .

, ( , ).

+1

Source: https://habr.com/ru/post/1775914/


All Articles