O'Reilly logo

OpenGL ES 3.0 Cookbook by Parminder Singh

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

Implementing picking with the ray trace technique

Picking is a process of selecting objects in the 3D space contained in a scene by user inputs. This is a very common requirement in 3D graphic applications, where you may be interested in an object tapped by an end user. The tapped point contains position in the screen coordinate system, which is a reference to the viewport. This reference point can be used in various picking techniques to detect the tapped object. In the present recipe, we will use a very versatile picking technique called "ray picking" or "ray trace pick".

In this technique, a ray is simulated using the tapped point in the scene. When the ray intersects with an object, it's assumed to be clicked on. The ray can be intersected ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required