Software Open Access

WEBGL 3D object picker for p5.js

Harris, David

An easy-to-use p5.js 3D object picker for visual artists

This set of functions allows a simple-to-use implementation of 3D object picking for beginning p5.js coders. It works by creating a hidden parallel 3D WEBGL model in which all objects in the visible model have corresponding objects with a color determined by the object's assigned ID number. To identify an object the color of the hidden canvas at a particular point then gives the ID number of the object closest to the camera at that point.

Files (58.5 kB)
Name Size
58.5 kB Download


Cite as