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

Ansible warning on jinja2 braces on when -

Parsing a protocol message from Go by Java -

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