沿着整个屏幕上下旋转的Three.js OrbitControl试图进入360,但限制为180

时间:2018-04-13 08:52:43

标签: three.js rotation

在OrbitControls.js中有一个函数:

function handleMouseMoveRotate( event ) {
    //console.log( 'handleMouseMoveRotate' );

rotateEnd.set( event.clientX, event.clientY );
rotateDelta.subVectors( rotateEnd, rotateStart );

var element = scope.domElement === document ? scope.domElement.body : scope.domElement;

// rotating across whole screen goes 360 degrees around
rotateLeft( 2 * Math.PI * rotateDelta.x / element.clientWidth * scope.rotateSpeed );

// rotating up and down along whole screen attempts to go 360, but limited to 180
rotateUp( 2 * Math.PI * rotateDelta.y / element.clientHeight * scope.rotateSpeed );

rotateStart.copy( rotateEnd );

scope.update();

}

我想在整个屏幕上上下旋转360度,但限制为180.但它只能用于OrbitControls.js。
任何帮助表示赞赏!!!!

0 个答案:

没有答案