If you what to see how its done in Shapes3D V3 then you should look at the Shape3D.java source file on Sourceforge.
Every shape inherits from this class and there are three key methods you should look at, first the method to render the shape and the second draw its to the pickbuffer. These methods start at line 1020
In the draw method there are two key lines
on_canvas = pg;
which remembers the canvas the shape is being rendered on we need this because we need to make sure we use the correct pickbuffer, and
on_canvas_matrix = pg.getMatrix().get();
which remembers the current transformation matrix just before the shape is rendered.
Now if you look in the next method,
public void drawPickBuffer(PGraphics pg) you see the line
this is where where we apply the matrix for rendering to the pickbuffer.
Finally in the same class we have a static method to perform the picking, see line 98.
This line is interesting because it shows that every rendering canvas has its own pick buffer which is why we need to remember it in the
PGraphics colorBuffer = mapCanvas2ColorBuffer.get(canvas);
The next few lines creates the pickbuffer if it hasn’t already been made or create a new one if the rendering canvas has changed size. Once this is done we draw all appropiate shapes to the pickbuffer
Hope this helps