Search code examples
three.jscameramodels

two model in one scene


I think two canvas on a page, load the two models, right hand slide, can compare, but now found a problem, fingers sliding at the same time, the program will mistake is magnified model, rather than rotating model?

So, I think of a way , a canvas, placed two camera, two models, fingers sliding, control both the location of the camera, make the model with rotating frequency, but the specific implementation, found that the model is relatively rotating, not with the effect of the rotation frequency?


Solution

  • I changed the location of the number of touches in the OrbitControls file to solve the problem of both fingers sliding and amplifying the model

    function onTouchStart( event ) {
            // debugger;
            if ( scope.enabled === false ) return;
    
            // switch ( event.touches.length ) {
            switch ( event.targetTouches.length ) {
            }
    }