Skip to content

Commit 5e38deb

Browse files
committed
Explain the definition of backface-visibility
This is editorial, so I'm doing it without discussion as we agreed. It took me a little while to puzzle out why the definition made sense, because I was thinking of elements as having zero thickness, so I thought I'd share the logic by putting it in the spec. It's very mathematical, but since the definition is completely matrix-based, that seems unavoidable.
1 parent 462bb88 commit 5e38deb

3 files changed

Lines changed: 50 additions & 0 deletions

File tree

css3-transforms/ChangeLog

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,6 @@
1+
2012-03-14 ayg@aryeh.name
2+
Explain the definition of backface-visibility
3+
14
2012-03-13 dschulze@adobe.com
25
Fixed typos in the SVG 'transform' attribute section.
36

css3-transforms/Overview.html

Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1908,6 +1908,28 @@ <h2 id=backface-visibility-property><span class=secno>12. </span> The
19081908

19091909
<div class=issue> Is the relevant matrix here really relative to the
19101910
viewport, or to the root of the 3D rendering context?</div>
1911+
1912+
<p class=note> The reasoning for this definition is as follows. Assume
1913+
elements are rectangles in the <var>x</var>&ndash;<var>y</var> plane with
1914+
infinitesimal thickness. The front of the untransformed element has
1915+
coordinates like (<var>x</var>, <var>y</var>, <var>&epsilon;</var>), and
1916+
the back is (<var>x</var>, <var>y</var>, &minus;<var>&epsilon;</var>), for
1917+
some very small <var>&epsilon;</var>. We want to know if after the
1918+
transformation, the front of the element is closer to the viewer than the
1919+
back (higher <var>z</var>-value) or further away. The
1920+
<var>z</var>-coordinate of the front will be
1921+
<var>M</var><sub>13</sub><var>x</var> +
1922+
<var>M</var><sub>23</sub><var>y</var> +
1923+
<var>M</var><sub>33</sub><var>&epsilon;</var> + <var>M</var><sub>43</sub>,
1924+
before accounting for perspective, and the back will be
1925+
<var>M</var><sub>13</sub><var>x</var> +
1926+
<var>M</var><sub>23</sub><var>y</var> &minus;
1927+
<var>M</var><sub>33</sub><var>&epsilon;</var> + <var>M</var><sub>43</sub>.
1928+
The first quantity is greater than the second if and only if
1929+
<var>M</var><sub>33</sub> > 0. (If it equals zero, the front and back are
1930+
equally close to the viewer. This probably means something like a
1931+
90-degree rotation, which makes the element invisible anyway, so we don't
1932+
really care whether it vanishes.)</p>
19111933
<!-- ======================================================================================================= -->
19121934

19131935
<h2 id=transform-functions><span class=secno>13. </span> The Transformation

css3-transforms/Transforms.src.html

Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1555,6 +1555,31 @@ <h2 id="backface-visibility-property">
15551555
Is the relevant matrix here really relative to the viewport, or to the root of the 3D rendering context?
15561556
</div>
15571557
</p>
1558+
<p class="note">
1559+
The reasoning for this definition is as follows. Assume
1560+
elements are rectangles in the <var>x</var>&ndash;<var>y</var>
1561+
plane with infinitesimal thickness. The front of the
1562+
untransformed element has coordinates like (<var>x</var>,
1563+
<var>y</var>, <var>&epsilon;</var>), and the back is
1564+
(<var>x</var>, <var>y</var>, &minus;<var>&epsilon;</var>), for
1565+
some very small <var>&epsilon;</var>. We want to know if after
1566+
the transformation, the front of the element is closer to the
1567+
viewer than the back (higher <var>z</var>-value) or further
1568+
away. The <var>z</var>-coordinate of the front will be
1569+
<var>M</var><sub>13</sub><var>x</var> +
1570+
<var>M</var><sub>23</sub><var>y</var> +
1571+
<var>M</var><sub>33</sub><var>&epsilon;</var> +
1572+
<var>M</var><sub>43</sub>, before accounting for perspective,
1573+
and the back will be <var>M</var><sub>13</sub><var>x</var> +
1574+
<var>M</var><sub>23</sub><var>y</var> &minus;
1575+
<var>M</var><sub>33</sub><var>&epsilon;</var> +
1576+
<var>M</var><sub>43</sub>. The first quantity is greater than
1577+
the second if and only if <var>M</var><sub>33</sub> > 0. (If
1578+
it equals zero, the front and back are equally close to the
1579+
viewer. This probably means something like a 90-degree
1580+
rotation, which makes the element invisible anyway, so we don't
1581+
really care whether it vanishes.)
1582+
</p>
15581583

15591584
<!-- ======================================================================================================= -->
15601585

0 commit comments

Comments
 (0)