Thanks a lot, I got something close to what I’m looking after but on some elements the mouse clicks doesn’t catch intersects.
I’m trying to reproduce a double click => focus like Sketchfab player but the following code misses for instance (particularly the left) hands of the farmer within your demo but catches the ‘ground’:
const onDoubleClick = ((event) => {
let containerOffset = offset(app.container)
pointer.x = ((event.clientX - containerOffset.left) / (app.container.clientWidth)) * 2 - 1;
pointer.y = - ((event.clientY- containerOffset.top ) / (app.container.clientHeight)) * 2 + 1;
raycaster.setFromCamera(pointer, app.camera);
// don't intersect anything on the left hand of the farmer demo
const intersects = raycaster.intersectObjects(app.scene.children, true)
Any idea on the matter?
Many thanks