Skip to content

Commit 3ab76d4

Browse files
committed
Some wordsmithing after reverting to the earlier 3d-transforms behavior
1 parent cca6f26 commit 3ab76d4

File tree

1 file changed

+21
-21
lines changed

1 file changed

+21
-21
lines changed

css-transforms-2/Overview.bs

+21-21
Original file line numberDiff line numberDiff line change
@@ -154,9 +154,9 @@ Authors can easily provide a fallback if UAs do not provide support for three-di
154154
The Transform Rendering Model {#transform-rendering}
155155
====================================================
156156

157-
Issue: fix this text to add to the text in CSS Transforms 1.
157+
This specification extends [[css-transforms-1#transform-rendering]] to account for the existence of three-dimensional transform functions, the Z value of 'transform-orign', the 'perspective' property, and a new 3D rendering model that applies when the used value of the ''transform-style'' property is ''preserve-3d''.
158158

159-
Three-dimensional transform functions extend this coordinate space into three dimensions, adding a Z axis perpendicular to the plane of the screen, that increases towards the viewer.
159+
Three-dimensional transform functions conceptually extend the coordinate space into three dimensions, adding a Z axis perpendicular to the plane of the screen, that increases towards the viewer.
160160

161161
<div class="figure">
162162
<img src="images/coordinates.svg" width="270" height="240" alt="Demonstration of the initial coordinate space">
@@ -166,24 +166,26 @@ Three-dimensional transform functions extend this coordinate space into three di
166166
</div>
167167

168168
<p id="transformation-matrix-computation">
169-
The <a>transformation matrix</a> is computed from the 'transform' and 'transform-origin' properties as follows:
169+
With 3D transforms, the Z component of 'transform-origin' affects the result, so the <a>transformation matrix</a> is computed from the 'transform' and 'transform-origin' properties as follows:
170170

171171
1. Start with the identity matrix.
172-
2. Translate by the computed X, Y and Z of 'transform-origin'
173-
3. Multiply by each of the transform functions in 'transform' property from left to right
174-
4. Translate by the negated computed X, Y and Z values of 'transform-origin'
175-
172+
2. Translate by the computed X, Y and Z of 'transform-origin'
173+
3. Multiply by each of the transform functions in 'transform' property from left to right
174+
4. Translate by the negated computed X, Y and Z values of 'transform-origin'
176175

177176
3D Transform Rendering {#3d-transform-rendering}
178177
----------------------
179178

180179
Normally, elements render as flat planes, and are rendered into the same plane as their stacking context. Often this is the plane shared by the rest of the page. Two-dimensional transform functions can alter the appearance of an element, but that element is still rendered into the same plane as its stacking context.
181180

182-
An element with a three-dimensional transform that is not contained in a <a>3D rendering context</a> renders with the appropriate transform applied, but does not intersect with any other elements. The three-dimensional transform in this case can be considered just as a painting effect, like two-dimensional transforms. Similarly, the transform does not affect painting order. For example, a transform with a positive Z translation may make an element look larger, but does not cause that element to
183-
render in front of elements with no translation in Z.
181+
An element with a three-dimensional transform that is not contained in a <a>3D rendering context</a> renders with the appropriate transform applied, but does not intersect with any other elements. The three-dimensional transform in this case can be considered just as a painting effect, like two-dimensional transforms. Similarly, the transform does not affect painting order. For example, a transform with a positive Z translation may make an element look larger, but does not cause that element to render in front of elements with no translation in Z.
182+
183+
Issue: describe how nested 3d-transformed elements render (perhaps with math)
184184

185185
<div class="example">
186186

187+
Issue: This example doesn't follow from the previous text.
188+
187189
This example shows the effect of three-dimensional transform applied to an element.
188190

189191
<pre>
@@ -211,10 +213,13 @@ This example shows the effect of three-dimensional transform applied to an eleme
211213
The transform is a 50&deg; rotation about the vertical, Y axis. Note how this makes the blue box appear narrower, but not three-dimensional.
212214
</div>
213215

214-
215216
### Perspective ### {#perspective}
216217

217-
The 'perspective' and 'perspective-origin' properties can be used to add a feeling of depth to a scene by making elements higher on the Z axis (closer to the viewer) appear larger, and those further away to appear smaller. The scaling is proportional to <var>d</var>/(<var>d</var> &minus; <var>Z</var>) where <var>d</var>, the value of 'perspective', is the distance from the drawing plane to the the assumed position of the viewer's eye.
218+
Perspective can be used to add a feeling of depth to a scene by making elements higher on the Z axis (closer to the viewer) appear larger, and those further away to appear smaller. The scaling is proportional to <var>d</var>/(<var>d</var> &minus; <var>Z</var>) where <var>d</var>, the value of 'perspective', is the distance from the drawing plane to the the assumed position of the viewer's eye.
219+
220+
The appearance of perspective can be applied to a 3d-transformed element in two ways. First, the element's 'transform function list' can contain the ''perspective()'' function which computes into the element's 'current transformation matrix'.
221+
222+
Second, the 'perspective' and 'perspective-origin' properties can be applied to an element to influence the rendering of its 3d-transformed children, giving them a shared perspective that provides the impression of them living in the same three-dimensional scene.
218223

219224
<div class="figure">
220225
<img alt="Diagram of scale vs. Z position" src="images/perspective_distance.png">
@@ -229,18 +234,14 @@ Normally the assumed position of the viewer's eye is centered on a drawing. This
229234
<img alt="Diagram of different perspective-origin" src="images/perspective_origin.png">
230235
<p class="caption">
231236
Diagram showing the effect of moving the perspective origin upward.
232-
233237
</div>
234238

235239
<p id="perspective-matrix-computation">
236240
The <a>perspective matrix</a> is computed as follows:
237-
<ol>
238-
<li>Start with the identity matrix.
239-
<li>Translate by the computed X and Y values of 'perspective-origin'
240-
<li>Multiply by the matrix that would be obtained from the ''perspective()'' transform function, where the length is provided by the value of the 'perspective' property
241-
<li>Translate by the negated computed X and Y values of 'perspective-origin'
242-
</ol>
243-
241+
1. Start with the identity matrix.
242+
2. Translate by the computed X and Y values of 'perspective-origin'
243+
3. Multiply by the matrix that would be obtained from the ''perspective()'' transform function, where the length is provided by the value of the 'perspective' property
244+
4. Translate by the negated computed X and Y values of 'perspective-origin'
244245

245246
<div class="example">
246247

@@ -267,7 +268,7 @@ This example shows how perspective can be used to cause three-dimensional transf
267268
</pre>
268269

269270
<div class="figure">
270-
<img src="examples/simple-perspective-example.png" width="210" height="190" alt="Div with a rotateY transform, and perspective on its container">
271+
<img src="examples/simple-perspective-example.png" width="210" height="190" alt="Div with a rotateY transform, and perspective on its container">
271272
</div>
272273

273274
The inner element has the same transform as in the previous example, but its rendering is now influenced by the perspective property on its parent element. Perspective causes vertices that have positive Z coordinates (closer to the viewer) to be scaled up in X and Y, and those further away (negative Z coordinates) to be scaled down, giving an appearance of depth.
@@ -283,7 +284,6 @@ The position of each element in that three-dimensional space is determined by ac
283284

284285
Elements establish and participate in 3D rendering contexts as follows:
285286

286-
287287
* A <a>3D rendering context</a> is established by a <a>transformable element</a> whose used value for 'transform-style' is ''transform-style/preserve-3d'' and which itself is not part of a 3D rendering context. An element that establishes a 3D rendering context also participates in that context.
288288
* An element whose used value for 'transform-style' is ''transform-style/preserve-3d'' and which itself participates in a <a>3D rendering context</a>, extends that 3D rendering context rather than establishing a new one.
289289
* An element participates in a <a>3D rendering context</a> if its parent establishes or extends a <a>3D rendering context</a>.

0 commit comments

Comments
 (0)