I have seen example codes for collision detection using Three.js which all have a piece of code as:
var vector = new THREE.Vector3( ( event.clientX / window.innerWidth ) * 2 - 1, - ( event.clientY / window.innerHeight ) * 2 + 1, 0.5 );
projector.unprojectVector( vector, camera );
my question is, what is event.clientX / window.innerWidth ) * 2 - 1 & event.clientY / window.innerHeight ) * 2 exactly? why these values?
I need to write a code for orthographic camera hit detection, but I first need to realize what is happening in perspective camera case.