Yes there is an extra parameter. Prior to V3 the pick function assumed that all shapes were drawn to the main sketch window. In V3 this changed so that shapes could be drawn to different viewports (PGraphics instances).
So your method picked = Shape3D.pickShape(this, mouseX, mouseY);
becomes picked = Shape3D.pickShape(this, getGraphics(), mouseX, mouseY);
I strongly recommend you look at the examples that come with V3 and also look at the guides for V3.
You could easily overload that method to just 3 parameters as it was before; given getGraphics() can be invoked by using the 1st parameter, which is of PApplet datatype:
public static Shape3D pickShape(PApplet papplet, int x, int y) {
return pickShape(papplet, papplet.getGraphics(), x, y);
}
The class Picked is a public access class with 3 constants shape : reference to the shape picked part : id of the part of the shape picked (integer) partID : binary flag showing the part picked (integer)
Sorry about that but V3 was released in January 2020 and I can’t remember what was in previous versions because they have been entirely replaced by V3.
V3 comes with new examples including those showing shape picking.
public static Shape3D pickShape(PApplet papplet, int x, int y){
if(pickBuffer == null || pickBuffer.width != papplet.width || pickBuffer.height != papplet.height){
pickBuffer = (PGraphics3D) papplet.createGraphics(papplet.width, papplet.height, P3D);
}
pickBuffer.noSmooth();
pickBuffer.beginDraw();
// Set the camera same as the drawing surface
pickBuffer.camera.set(((PGraphicsOpenGL)papplet.g).camera);
pickBuffer.projection.set(((PGraphicsOpenGL)papplet.g).projection);
pickBuffer.modelview.set(((PGraphicsOpenGL)papplet.g).modelview);
pickBuffer.noLights();
pickBuffer.noStroke();
pickBuffer.background(WHITE);
// Draw to the buffer
pickModeOn = true;
drawAll();
pickBuffer.endDraw();
int c = pickBuffer.get(x,y);
pickModeOn = false;
// Next line inserted just to get a copy of the buffer for testing
// make sure it is commented out before release.
//img = pickBuffer.get();
return pickMap.get(c);
}