We use cookies to ensure that we give you the best experience on our website. If you continue to use this site we will assume that you are happy with it.

koby

Forum Replies Created

Viewing 1 post (of 1 total)
  • Author
    Posts
  • in reply to: use camera-controls with App or camera lookAt #49241
    koby
    Participant

    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

Viewing 1 post (of 1 total)