src/components/look-controls.js
function (evt) {
    var direction;
    var canvas = this.el.sceneEl.canvas;
    var deltaY;
    var yawObject = this.yawObject;

    if (!this.touchStarted || !this.data.touchEnabled) { return; }

    deltaY = 2 * Math.PI * (evt.touches[0].pageX - this.touchStart.x) / canvas.clientWidth;

    direction = this.data.reverseTouchDrag ? 1 : -1;
    // Limit touch orientaion to to yaw (y axis).
    yawObject.rotation.y -= deltaY * 0.5 * direction;
    this.touchStart = {
      x: evt.touches[0].pageX,
      y: evt.touches[0].pageY
    };
  }
function (evt) {
    var direction;
    var canvas = this.el.sceneEl.canvas;
    var deltaY;
    var yawObject = this.yawObject;

    if (!this.touchStarted || !this.data.touchEnabled) { return; }

    deltaY = 2 * Math.PI * (evt.touches[0].pageX - this.touchStart.x) / canvas.clientWidth;

    direction = this.data.reverseTouchDrag ? 1 : -1;
    // Limit touch orientaion to to yaw (y axis).
    yawObject.rotation.y -= deltaY * 0.5 * direction;
    this.touchStart = {
      x: evt.touches[0].pageX,
      y: evt.touches[0].pageY
    };
  }
function ( evt ) { var direction ; var canvas = this . el . sceneEl . canvas ; var deltaY ; var yawObject = this . yawObject ; if ( ! this . touchStarted || ! this . data . touchEnabled ) { return ; } deltaY = 2 * Math . PI * ( evt . touches [ 0 ] . pageX - this . touchStart . x ) / canvas . clientWidth ; direction = this . data . reverseTouchDrag ? 1 : - 1 ; // Limit touch orientaion to to yaw (y axis). yawObject . rotation . y -= deltaY * 0.5 * direction ; this . touchStart = { x : evt . touches [ 0 ] . pageX , y : evt . touches [ 0 ] . pageY } ; }
Translate touch move to Y-axis rotation.
Translate touch move to Y - axis rotation .