As I delve into the world of Interaction with Three.js, several questions arise in my mind.
1) Can you shed some light on what exactly Viewport Coordinates are?
2) In what ways do they differ from client Coordinates?
3) How did we come up with this formula?
var vpx = ( eltx / div.offsetWidth ) * 2 - 1;
var vpy = - ( elty / div.offsetHeight ) * 2 + 1;
// vp->viewport, eltx->client coords,div->The div where webGL renderer has been appended.
4) What's the reasoning behind assigning the third coordinate in viewport System a value between 0.5 to 1 when considering the vector?
I would greatly appreciate it if you could provide detailed explanations for these questions and the underlying concept. If possible, recommend a book for further reading. Visual aids like 3D diagrams for the first question would be incredibly helpful. Thank you very much in advance.