综合编程

mouse as vanishing point

微信扫一扫,分享到朋友圈

mouse as vanishing point
0

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

阅读原文...


微信扫一扫,分享到朋友圈

mouse as vanishing point
0

CSS3 Recipes

Don't get fooled by Fake Agile

上一篇

Maintaining MongoDB Replica Sets in the Cloud Using Ansible

下一篇

评论已经被关闭。

插入图片

热门分类

往期推荐

mouse as vanishing point

长按储存图像,分享给朋友