O'Reilly logo

WebGL Beginner's Guide by Brandon Jones, Diego Cantor

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

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 ...

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