当前位置: 首页>>代码示例>>TypeScript>>正文


TypeScript THREE.Vector2类代码示例

本文整理汇总了TypeScript中THREE.Vector2的典型用法代码示例。如果您正苦于以下问题:TypeScript Vector2类的具体用法?TypeScript Vector2怎么用?TypeScript Vector2使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。


在下文中一共展示了Vector2类的10个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的TypeScript代码示例。

示例1: handleTouchMoveDolly

	function handleTouchMoveDolly( event ) {

		//console.log( 'handleTouchMoveDolly' );

		var dx = event.touches[ 0 ].pageX - event.touches[ 1 ].pageX;
		var dy = event.touches[ 0 ].pageY - event.touches[ 1 ].pageY;

		var distance = Math.sqrt( dx * dx + dy * dy );

		dollyEnd.set( 0, distance );

		dollyDelta.subVectors( dollyEnd, dollyStart );

		if ( dollyDelta.y > 0 ) {

			dollyOut( getZoomScale() );

		} else if ( dollyDelta.y < 0 ) {

			dollyIn( getZoomScale() );

		}

		dollyStart.copy( dollyEnd );

		scope.update();

	}
开发者ID:timofeevda,项目名称:seismic-beachballs-demo,代码行数:28,代码来源:three.orbitcontrols.ts

示例2: handleTouchMovePan

	function handleTouchMovePan( event ) {

		//console.log( 'handleTouchMovePan' );

		panEnd.set( event.touches[ 0 ].pageX, event.touches[ 0 ].pageY );

		panDelta.subVectors( panEnd, panStart );

		pan( panDelta.x, panDelta.y );

		panStart.copy( panEnd );

		scope.update();

	}
开发者ID:timofeevda,项目名称:seismic-beachballs-demo,代码行数:15,代码来源:three.orbitcontrols.ts

示例3: handleMouseMovePan

	function handleMouseMovePan( event ) {

		//console.log( 'handleMouseMovePan' );

		panEnd.set( event.clientX, event.clientY );

		panDelta.subVectors( panEnd, panStart );

		pan( panDelta.x, panDelta.y );

		panStart.copy( panEnd );

		scope.update();

	}
开发者ID:timofeevda,项目名称:seismic-beachballs-demo,代码行数:15,代码来源:three.orbitcontrols.ts

示例4: handleTriangle

        function handleTriangle(a, b, c) {

            vA.fromArray(positions, a * 3);
            vB.fromArray(positions, b * 3);
            vC.fromArray(positions, c * 3);

            uvA.fromArray(uvs, a * 2);
            uvB.fromArray(uvs, b * 2);
            uvC.fromArray(uvs, c * 2);

            var x1 = vB.x - vA.x;
            var x2 = vC.x - vA.x;

            var y1 = vB.y - vA.y;
            var y2 = vC.y - vA.y;

            var z1 = vB.z - vA.z;
            var z2 = vC.z - vA.z;

            var s1 = uvB.x - uvA.x;
            var s2 = uvC.x - uvA.x;

            var t1 = uvB.y - uvA.y;
            var t2 = uvC.y - uvA.y;

            var r = 1.0 / (s1 * t2 - s2 * t1);

            sdir.set(
                (t2 * x1 - t1 * x2) * r,
                (t2 * y1 - t1 * y2) * r,
                (t2 * z1 - t1 * z2) * r
            );

            tdir.set(
                (s1 * x2 - s2 * x1) * r,
                (s1 * y2 - s2 * y1) * r,
                (s1 * z2 - s2 * z1) * r
            );

            tan1[a].add(sdir);
            tan1[b].add(sdir);
            tan1[c].add(sdir);

            tan2[a].add(tdir);
            tan2[b].add(tdir);
            tan2[c].add(tdir);

        }
开发者ID:jkstrawn,项目名称:lighthouse,代码行数:48,代码来源:bufferGeometryUtils.ts

示例5: handleTouchStartPan

	function handleTouchStartPan( event ) {

		//console.log( 'handleTouchStartPan' );

		panStart.set( event.touches[ 0 ].pageX, event.touches[ 0 ].pageY );

	}
开发者ID:timofeevda,项目名称:seismic-beachballs-demo,代码行数:7,代码来源:three.orbitcontrols.ts

示例6: handleTouchStartRotate

	function handleTouchStartRotate( event ) {

		//console.log( 'handleTouchStartRotate' );

		rotateStart.set( event.touches[ 0 ].pageX, event.touches[ 0 ].pageY );

	}
开发者ID:timofeevda,项目名称:seismic-beachballs-demo,代码行数:7,代码来源:three.orbitcontrols.ts

示例7: handleMouseDownPan

	function handleMouseDownPan( event ) {

		//console.log( 'handleMouseDownPan' );

		panStart.set( event.clientX, event.clientY );

	}
开发者ID:timofeevda,项目名称:seismic-beachballs-demo,代码行数:7,代码来源:three.orbitcontrols.ts

示例8: handleMouseDownDolly

	function handleMouseDownDolly( event ) {

		//console.log( 'handleMouseDownDolly' );

		dollyStart.set( event.clientX, event.clientY );

	}
开发者ID:timofeevda,项目名称:seismic-beachballs-demo,代码行数:7,代码来源:three.orbitcontrols.ts

示例9: handleMouseDownRotate

	function handleMouseDownRotate( event ) {

		//console.log( 'handleMouseDownRotate' );

		rotateStart.set( event.clientX, event.clientY );

	}
开发者ID:timofeevda,项目名称:seismic-beachballs-demo,代码行数:7,代码来源:three.orbitcontrols.ts

示例10: handleTouchMoveRotate

	function handleTouchMoveRotate( event ) {

		//console.log( 'handleTouchMoveRotate' );

		rotateEnd.set( event.touches[ 0 ].pageX, event.touches[ 0 ].pageY );
		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();

	}
开发者ID:timofeevda,项目名称:seismic-beachballs-demo,代码行数:20,代码来源:three.orbitcontrols.ts


注:本文中的THREE.Vector2类示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。