如何使用CSS3来纠偏鱼眼全景?全景、如何使用

由网友(虚伪的情话丶)分享简介:我觉得它来的时候我闪全景转换为JS / HTML5 / CSS3。我已经看到了使用不同的平面图像的一些优雅的解决方案,但我都是鱼...... I feel that it has come time to convert my flash panoramas to js/html5/css3. I've seen s...

我觉得它来的时候我闪全景转换为JS / HTML5 / CSS3。我已经看到了使用不同的平面图像的一些优雅的解决方案,但我都是鱼......

I feel that it has come time to convert my flash panoramas to js/html5/css3. I've seen some elegant solutions using separate flat images, but mine are all fisheye...

我的直觉告诉我,这是可行的使用-webkit-变换:的Matrix3D但我不太打它。

My intuition tells me that it's doable using -webkit-transform: matrix3d but I'm not quite hitting it.

任何想法,如果这真能在CSS3做?

Any ideas if this can really be done in css3?

Thanksya亲切。

Thanksya kindly.

推荐答案

是的,这是可以做到的,但你最好知道你的数学。请注意,您不使用CSS3,而是一个专有扩展,这将只能在WebKit的浏览器。你可能会更好使用Canvas元素的工作,不仅是它支持更多的浏览器,它也给你更大的自由,做任何改造你的愿望。

Yes, it can be done, but you better know your mathematics. Note that you are not using CSS3 but rather a proprietary extension, this will only work in webkit browsers. You'll probably be better off using a Canvas element for the job, not only is it supported by more browsers, it also gives you far greater freedom to do whatever transformation you desire.

编辑: 那么,砍你的图像为若干细纵切片,每片应该由大约1 / COS缩放([角度偏离中心]),并偏向考虑的角度是在正确的和的左侧不同片。这样,您就应该结束了一个逆鱼眼形,其中顶部和图像的底部是凹的,你可能需要将其切割成正方形。

Well then, cut your image into a number of thin vertical slices, each slice should be scaled by approx 1/cos([angle off centre]), and skewed to account for the angle being different at the right and the left side of the slice. This way you should end up with an "inverse fisheye" shape where the top and the bottom of the image is concave, you might want to cut it to a square.

阅读全文

相关推荐

最新文章