Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[css-transforms-2] Add ''perspective(none)''. #6691

Merged
merged 1 commit into from
Sep 29, 2021
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
11 changes: 7 additions & 4 deletions css-transforms-2/Overview.bs
Original file line number Diff line number Diff line change
Expand Up @@ -122,7 +122,7 @@ Terminology {#terminology}
''rotateY(0)'',
''rotateZ(0)''
and ''matrix3d(1, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1)''.
A special case is perspective: ''perspective(infinity)''.
A special case is perspective: ''perspective(none)''.
The value of m<sub>34</sub> becomes infinitesimal small
and the transform function is therefore assumed to be equal to the identity matrix.

Expand Down Expand Up @@ -983,7 +983,7 @@ In the following <dfn export>3d transform functions</dfn>, a <<zero>> behaves th
:: same as ''rotate3d(0, 1, 0, &lt;angle>)''.
: <span class='prod'><dfn>rotateZ()</dfn> = rotateZ( [ <<angle>> | <<zero>> ] )</span>
:: same as ''rotate3d(0, 0, 1, &lt;angle>)'', which is a 3d transform equivalent to the 2d transform ''rotate(&lt;angle>)''.
: <span class='prod'><dfn>perspective()</dfn> = perspective( <<length [0,∞]>> )</span>
: <span class='prod'><dfn>perspective()</dfn> = perspective( <<length [0,∞]>> | ''none'' )</span>
:: specifies a <a href="#PerspectiveDefined">perspective projection matrix</a>. This matrix scales points in X and Y based on their Z value, scaling points with positive Z values away from the origin, and those with negative Z values towards the origin. Points on the z=0 plane are unchanged. The parameter 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. For example, a value of 1000px gives a moderate amount of foreshortening and a value of 200px gives an extreme amount.

If the depth value is less than ''1px'',
Expand Down Expand Up @@ -1378,9 +1378,12 @@ One translation unit on a matrix is equivalent to 1 pixel in the local coordinat
</div>

<li id="PerspectiveDefined">
A perspective projection matrix with the parameter <em>d</em> is equivalent to the matrix:
A perspective projection matrix with the parameter <var>d</var> is equivalent to the matrix:

$$\begin{bmatrix} 1 & 0 & 0 & 0 \\ 0 & 1 & 0 & 0 \\ 0 & 0 & 1 & 0 \\ 0 & 0 & -1/d & 1 \end{bmatrix}$$
$$\begin{bmatrix} 1 & 0 & 0 & 0 \\ 0 & 1 & 0 & 0 \\ 0 & 0 & 1 & 0 \\ 0 & 0 & -1/d & 1 \end{bmatrix}$$

If the parameter <var>d</var> is ''none'' it is treated as infinity
(and the resulting matrix is the identity matrix).

</ul>

Expand Down