Architectural updates

The picking method described in this chapter has been implemented in our architecture:

Architectural updates

We have replaced the draw function with the render function. This function is the same that we previously described in the section Rendering to an offscreen framebuffer.

There is a new class: Picker. The source code for this class can be obtained from /js/webgl/Picker.js. This class encapsulates the offscreen framebuffer and encapsulates the code necessary to create it, configure it, and read from it.

We also updated the class CameraInteractor to notify the picker whenever the user clicks on the canvas. The following diagram explains how the ...

Get WebGL Beginner's Guide now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.