-webkit-perspective是什么? [英] What is the math behind -webkit-perspective?

查看:633
本文介绍了-webkit-perspective是什么?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

简单的问题,我找不到答案 - -webkit-perspective 实际上是在数学上做什么? (我知道它的效果,它基本上像焦距控制​​)。 -webkit-perspective:500 是什么意思??

"Simple" question that I can't find the answer to -- What does -webkit-perspective actually do mathematically? (I know the effect it has, it basically acts like a focal-length control) e.g. what does -webkit-perspective: 500 mean?!?

我需要找到屏幕上的位置使用 -webkit-perspective

I need to find the on-screen location of something that's been moved using, among other things, -webkit-perspective

推荐答案

p> CSS 3D转换模块工作草稿提供了以下说明:

The CSS 3D Transforms Module working draft gives the following explanation:


透视(< number>)

透视投影矩阵。该矩阵将观看立方体映射到基本与
观看者无穷远的金字塔上,并且其峰值表示观看者的位置。可见
区域是由视口的四个边缘(用于在
之间呈现网页的浏览器窗口的
部分,观看者的位置和在无限远处的点)从
查看器)。作为函数的参数给出的深度代表
z = 0平面距观察者的距离。较低的值给出
更扁平的金字塔,因此更加明显的透视
效果。该值以像素为单位给出,因此值为1000给出
中等量的透视,值为200给出极端的
量。通过从单位矩阵开始计算矩阵,并且用值-1 /深度替换行3,列4处的值的
来计算矩阵。
的深度值必须大于零,否则函数为
无效。

specifies a perspective projection matrix. This matrix maps a viewing cube onto a pyramid whose base is infinitely far away from the viewer and whose peak represents the viewer's position. The viewable area is the region bounded by the four edges of the viewport (the portion of the browser window used for rendering the webpage between the viewer's position and a point at a distance of infinity from the viewer). The depth, given as the parameter to the function, represents the distance of the z=0 plane from the viewer. Lower values give a more flattened pyramid and therefore a more pronounced perspective effect. The value is given in pixels, so a value of 1000 gives a moderate amount of foreshortening and a value of 200 gives an extreme amount. The matrix is computed by starting with an identity matrix and replacing the value at row 3, column 4 with the value -1/depth. The value for depth must be greater than zero, otherwise the function is invalid.

的开始,如果不是完全清楚。第一句话让我相信维基百科上的透视投影矩阵文章可能有所帮助,虽然在评论在这篇文章中,我们发现CSS工作组的惯例与维基百科中的惯例可能有一些细微的差别,所以请检查一下,以避免头痛。

This is something of a start, if not entirely clear. The first sentence leads me to believe the perspective projection matrix article on Wikipedia might be of some help, although in the comments on this post it is revealed there might be some slight differences between the CSS Working Group's conventions and those found in Wikipedia, so please check those out to save yourself a headache.

这篇关于-webkit-perspective是什么?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆