<output id="qn6qe"></output>

    1. <output id="qn6qe"><tt id="qn6qe"></tt></output>
    2. <strike id="qn6qe"></strike>

      亚洲 日本 欧洲 欧美 视频,日韩中文字幕有码av,一本一道av中文字幕无码,国产线播放免费人成视频播放,人妻少妇偷人无码视频,日夜啪啪一区二区三区,国产尤物精品自在拍视频首页,久热这里只有精品12
      代碼改變世界

      Using AlloyTouch to control three.js 3D model

      2016-12-08 08:50  【當耐特】  閱讀(1059)  評論(0)    收藏  舉報

      As you can see, the above cube rotation, acceleration, deceleration stop all through the AlloyTouch to achieve.

      Demo(Mobile)

      Code

      <script src="asset/three.js"></script>
      <script src="../../alloy_touch.js"></script>
      
      <script>
          var camera = new THREE.PerspectiveCamera( 70, window.innerWidth / window.innerHeight, 1, 1000 );
          camera.position.z = 500;
      
          var scene = new THREE.Scene();
      
          var texture = new THREE.TextureLoader().load( 'asset/crate.gif' );
          var geometry = new THREE.BoxBufferGeometry( 200, 200, 200 );
          var material = new THREE.MeshBasicMaterial( { map: texture } );
      
          var mesh = new THREE.Mesh( geometry, material );
          scene.add( mesh );
      
          var renderer = new THREE.WebGLRenderer();
          renderer.setPixelRatio( window.devicePixelRatio );
          renderer.setSize( window.innerWidth, window.innerHeight );
          document.body.appendChild( renderer.domElement );
      
          function animate() {
              requestAnimationFrame( animate );
              renderer.render( scene, camera );
          }
          
          animate();
      
          new AlloyTouch({
              touch: document,	//touch the whole document
              vertical: false,	//monitor horizontal touch
              target: mesh.rotation,	//animate mesh.rotation's y property
              property: "y",		
              factor: 0.08,		//friction coefficient
              moveFactor: 0.2		//touch move friction coefficient
          })
      </script>
      

      factor need to continue to debug the best value for the speed and time of inertial motion let go after the best effect.
      moveFactor need to continue to debug the best value, is to let the lateral drag distance map to achieve the rotation angle.

      If you don't need an inertial motion. For example, the king of glory in the task rotation is not inertia, the finger left the screen will immediately stop moving. Such as:

      You only need to set the AlloyTouch inertia to false.

      Non inertia demo

      Code

      <script src="asset/three.js"></script>
      <script src="../../alloy_touch.js"></script>
      <script>
        	...
        	...
          ...
          animate();
      
          new AlloyTouch({
              touch: document,	
              vertical: false,			
              target: mesh.rotation,	
              property: "y",				
              factor: 0.08,				
              moveFactor: 0.2 ,		
              inertia: false	 //disable the inertia animation
          })
      </script>
      

      AlloyTouch

      Github:https://github.com/AlloyTeam/AlloyTouch
      Any question, please let me know:https://github.com/AlloyTeam/AlloyTouch/issues

      主站蜘蛛池模板: 苍井空浴缸大战猛男120分钟| 亚洲香蕉网久久综合影视| 国产中文字幕在线一区| 亚日韩精品一区二区三区| 丰满少妇被猛烈进出69影院| 人妻另类 专区 欧美 制服| 精品一区精品二区制服| 久久精品国产99久久久古代| 中国丰满少妇人妻xxx性董鑫洁| 天堂资源国产老熟女在线| 97久久超碰亚洲视觉盛宴| 社会| 国产在线线精品宅男网址| 国产亚洲精品黑人粗大精选| 丰满人妻一区二区三区无码AV| a级国产乱理伦片在线观看al | 欧美性大战xxxxx久久久| 69天堂人成无码免费视频| 国产老熟女无套内射不卡| 性色欲情网站iwww九文堂| 99re热这里只有精品视频| 99久久免费精品国产色| 少妇愉情理伦片高潮日本| 人妻中文字幕一区二区三| 好男人社区神马在线观看www| 成人网站免费观看| 少妇粗大进出白浆嘿嘿视频| 国内精品人妻无码久久久影院导航| 日韩一区二区三区理伦片| 极品少妇的粉嫩小泬视频| 亚洲国产精品综合久久网络| 农村肥熟女一区二区三区| 成全影视大全在线观看| a4yy私人毛片| 99久久精品国产一区二区蜜芽| 开心色怡人综合网站| 国产亚洲精品国产福APP| 亚洲成人精品一区二区中| 大地资源中文在线观看西瓜| 乱人伦人妻中文字幕在线| 国产无套白浆一区二区|