Skip to content

Commit 957029b

Browse files
committed
More details for definition of perspective
Original patch by Tav. Fixes https://www.w3.org/Bugs/Public/show_bug.cgi?id=16327.
1 parent 622efe4 commit 957029b

5 files changed

Lines changed: 80 additions & 4 deletions

File tree

css3-transforms/ChangeLog

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,8 @@
1+
2012-03-19 ayg@aryeh.name
2+
More details for definition of perspective
3+
Original patch by Tav.
4+
Fixes https://www.w3.org/Bugs/Public/show_bug.cgi?id=16327.
5+
16
2012-03-19 ayg@aryeh.name
27
Better definition for backface-visibility
38
Fixes https://www.w3.org/Bugs/Public/show_bug.cgi?id=16349.

css3-transforms/Overview.html

Lines changed: 31 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -699,7 +699,37 @@ <h3 id=transform-3d-rendering><span class=secno>5.1. </span>3D Transform
699699
class=property>perspective-origin</code></code></a>&rsquo; properties can
700700
be used to add a feeling of depth to a scene by making elements higher on
701701
the Z axis (closer to the viewer) appear larger, and those further away to
702-
appear smaller.
702+
appear smaller. The scaling is proportional to <var>d</var>/(<var>d</var>
703+
&minus; <var>Z</var>) where <var>d</var>, the value of &lsquo;<a
704+
href="#perspective"><code class=css><code
705+
class=property>perspective</code></code></a>&rsquo;, is the distance from
706+
the drawing plane to the the assumed position of the viewer's eye.
707+
708+
<div class=figure> <img alt="Diagram of scale vs. Z position"
709+
src="perspective_distance.png">
710+
<p class=caption> Diagrams showing how scaling depends on the &lsquo;<a
711+
href="#perspective"><code class=css><code
712+
class=property>perspective</code></code></a>&rsquo; property and Z
713+
position. In the top diagram, <var>Z</var> is half of <var>d</var>. In
714+
order to make it appear that the original circle (solid outline) appears
715+
at <var>Z</var> (dashed circle), the circle is scaled up by a factor of
716+
two, resulting in the light blue circle. In the bottom diagram, the
717+
circle is scaled down by a factor of one-third to make it appear behind
718+
the original position.</p>
719+
</div>
720+
721+
<p> Normally the assumed position of the viewer's eye is centered on a
722+
drawing. This position can be moved if desired &ndash; for example, if a
723+
web page contains multiple drawings that should share a common perspective
724+
&ndash; by setting &lsquo;<a href="#perspective-origin"><code
725+
class=css><code
726+
class=property>perspective-origin</code></code></a>&rsquo;.
727+
728+
<div class=figure> <img alt="Diagram of different perspective-origin"
729+
src="perspective_origin.png">
730+
<p class=caption> Diagram showing the effect of moving the perspective
731+
origin upward.</p>
732+
</div>
703733

704734
<p id=perspective-matrix-computation> The <a
705735
href="#TermPerspectiveMatrix"><i>perspective matrix</i></a> is computed as

css3-transforms/Transforms.src.html

Lines changed: 44 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -422,10 +422,51 @@ <h3 id="transform-3d-rendering">3D Transform Rendering</h3>
422422
</div>
423423

424424
<p>
425-
The '<code class="property">perspective</code>' and '<code class="property">perspective-origin</code>'
426-
properties can be used to add a feeling of depth to a scene by making elements higher on the Z axis
427-
(closer to the viewer) appear larger, and those further away to appear smaller.
425+
The '<code class="property">perspective</code>' and
426+
'<code class="property">perspective-origin</code>'
427+
properties can be used to add a feeling of depth to a
428+
scene by making elements higher on the Z axis (closer to
429+
the viewer) appear larger, and those further away to
430+
appear smaller. The scaling is proportional to
431+
<var>d</var>/(<var>d</var> &minus; <var>Z</var>)
432+
where <var>d</var>, the value of
433+
'<code class="property">perspective</code>', is the
434+
distance from the drawing plane to the the assumed
435+
position of the viewer's eye.
428436
</p>
437+
438+
<div class="figure">
439+
<img alt="Diagram of scale vs. Z position" src="perspective_distance.png">
440+
<p class="caption">
441+
Diagrams showing how scaling depends on the
442+
'<code class="property">perspective</code>' property
443+
and Z position. In the top diagram, <var>Z</var> is half of <var>d</var>. In
444+
order to make it appear that the original circle
445+
(solid outline) appears at <var>Z</var> (dashed
446+
circle), the circle is scaled up by a factor of two,
447+
resulting in the light blue circle. In the bottom
448+
diagram, the circle is scaled down by a factor of
449+
one-third to make it appear behind the original
450+
position.
451+
</p>
452+
</div>
453+
454+
<p>
455+
Normally the assumed position of the viewer's eye is
456+
centered on a drawing. This position can be moved if
457+
desired &ndash; for example, if a web page contains
458+
multiple drawings that should share a common perspective
459+
&ndash; by setting
460+
'<code class="property">perspective-origin</code>'.
461+
</p>
462+
463+
<div class="figure">
464+
<img alt="Diagram of different perspective-origin" src="perspective_origin.png">
465+
<p class="caption">
466+
Diagram showing the effect of moving the perspective origin upward.
467+
</p>
468+
</div>
469+
429470
<p id="perspective-matrix-computation">
430471
The <a href="#TermPerspectiveMatrix"><i>perspective matrix</i></a> is computed as follows:
431472
<!-- Make this more mathy, with matrices? -->
21.8 KB
Loading
12.3 KB
Loading

0 commit comments

Comments
 (0)