In this Fiddle
you can see my implementation.
It basically works as itended, but there are some spots where the angle changes abruptly and not smoothly. Play with your mouse and find out. (When X-Position of the mouse is about the X-Position of the vanishing Line). Also I don’t get why the vanishing Line is not following the mouse farther than 45°.
lineRad = Math.asin(Math.sin(vertDist / mouseLineDist)); lineRad = (mouseX - lineX) >= 0 ? lineRad : -lineRad + Math.PI; lineRad = (mouseY - lineY) >= 0 ? lineRad : -lineRad;
This could be the origin of the jumps, but I am not sure.
I just checked this under Firefox. It seems to have major performance issues.
So this prototype works in Chrome. Any Suggestions for performance and browser compatibility are also appreciated.
Problem courtesy of: PeterUstinox