Viewhelper problem (two camera)

I created a viewhelper like this;

as you can see,the viewhelper is in a small viewport (left bottom)

but when i clicked the small viewport,something in the another viewport is triggered;

what i wanna is ability to click on elements in both views normally

thanks

You need to detach camera which is not in use and then attach it again when needed.

camera.detachControl(canvas)
camera.attachControl(canvas)

thanks for your reply,i do that ,but the pick result has no change

    camera2.detachControl(canvas)
    camera1.attachControl(canvas)

    before:
        scene.activeCameras.push(camera1);
        scene.activeCameras.push(camera2);
    after:
        scene.activeCameras.push(camera2);
        scene.activeCameras.push(camera1);

and

        const axis =showAxis(0.1)
        axis.parent = gizmo._rootMesh;
        axis.layerMask = 0x20000000;

        **axis.isPickable = false**

        const labels = char(0.08,0.11)
        labels.forEach(l=>{
            l.parent = gizmo._rootMesh;
            l.layerMask = 0x20000000;
            **l.isPickable = false**
        })

However, if we have to add the order of the camera and the element pickable attribute to control the switch, it can be very inconvenient

You can set scene.cameraToUseForPointers to define the camera to use for the pointer events.

4 Likes

I have to say this is a very useful api :heart_eyes:

1 Like

This really helped me :heart:

1 Like