javascript - a questionabout three.js when i use trackballcontrols.js -


i try use trackballcontrols.js in project need modification,and cant understand these code ,can give me explanation?

var getmouseoncircle = ( function () {      var vector = new three.vector2();      return function getmouseoncircle( pagex, pagey ) {          vector.set(             ( ( pagex - _this.screen.width * 0.5 - _this.screen.left ) / ( _this.screen.width * 0.5 ) ),             ( ( _this.screen.height + 2 * ( _this.screen.top - pagey ) ) / _this.screen.width ) // screen.width intentional         );          return vector;      };  }() ); 

this code converts coordinate of mouse position normalized 2d vector (to use rotation calculation).

enter image description here


Comments

Popular posts from this blog

javascript - Replicate keyboard event with html button -

node.js - Node js - Trying to send POST request, but it is not loading javascript content -

javascript - Web audio api 5.1 surround example not working in firefox -