<?xml version="1.0" encoding="UTF-8" standalone="yes" ?>
<!DOCTYPE bugzilla SYSTEM "https://www.w3.org/Bugs/Public/page.cgi?id=bugzilla.dtd">

<bugzilla version="5.0.4"
          urlbase="https://www.w3.org/Bugs/Public/"
          
          maintainer="sysbot+bugzilla@w3.org"
>

    <bug>
          <bug_id>9235</bug_id>
          
          <creation_ts>2010-03-12 19:54:20 +0000</creation_ts>
          <short_desc>&lt;canvas&gt;: perspective transformations</short_desc>
          <delta_ts>2016-04-21 16:09:08 +0000</delta_ts>
          <reporter_accessible>1</reporter_accessible>
          <cclist_accessible>1</cclist_accessible>
          <classification_id>1</classification_id>
          <classification>Unclassified</classification>
          <product>WHATWG</product>
          <component>HTML</component>
          <version>unspecified</version>
          <rep_platform>All</rep_platform>
          <op_sys>All</op_sys>
          <bug_status>RESOLVED</bug_status>
          <resolution>FIXED</resolution>
          
          
          <bug_file_loc>http://www.whatwg.org/specs/web-apps/current-work/#transformations</bug_file_loc>
          <status_whiteboard></status_whiteboard>
          <keywords></keywords>
          <priority>P3</priority>
          <bug_severity>enhancement</bug_severity>
          <target_milestone>Needs Impl Interest</target_milestone>
          
          
          <everconfirmed>1</everconfirmed>
          <reporter>contributor</reporter>
          <assigned_to name="Ian &apos;Hixie&apos; Hickson">ian</assigned_to>
          <cc>brille1</cc>
    
    <cc>excors</cc>
    
    <cc>ian</cc>
    
    <cc>junov</cc>
    
    <cc>mike</cc>
    
    <cc>mjs</cc>
    
    <cc>public-html-admin</cc>
    
    <cc>public-html-wg-issue-tracking</cc>
    
    <cc>robin</cc>
          
          <qa_contact name="HTML WG Bugzilla archive list">public-html-bugzilla</qa_contact>

      

      

      

          <comment_sort_order>oldest_to_newest</comment_sort_order>  
          <long_desc isprivate="0" >
    <commentid>32918</commentid>
    <comment_count>0</comment_count>
    <who name="">contributor</who>
    <bug_when>2010-03-12 19:54:20 +0000</bug_when>
    <thetext>Section: http://www.whatwg.org/specs/web-apps/current-work/#transformations

Comment:
An additional useful transformation would be Perspective.

Posted from: 93.206.128.135</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>32919</commentid>
    <comment_count>1</comment_count>
    <who name="Axel Dahmen">brille1</who>
    <bug_when>2010-03-12 19:57:41 +0000</bug_when>
    <thetext>Perspecive would make it possible to add pseudo 3D to 2D surfaces.

A possible function declaration would be:

 context.perspective(dx1,dy1,dx2,dy2,dx3,dy3,dx4,dy5)

Where parameters constitute four tuples, describing an offset from each of the four viewport corners.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>33736</commentid>
    <comment_count>2</comment_count>
    <who name="Axel Dahmen">brille1</who>
    <bug_when>2010-03-20 17:27:50 +0000</bug_when>
    <thetext>I wrote a typo by mistake. The perspective function declaration should look like this, of course:

 context.perspective(dx1,dy1, dx2,dy2, dx3,dy3, dx4,dy4)

The tuples should be given in this sequence: top-left, top-right, bottom-left, bottom-right.
</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>33737</commentid>
    <comment_count>3</comment_count>
    <who name="Maciej Stachowiak">mjs</who>
    <bug_when>2010-03-21 00:02:15 +0000</bug_when>
    <thetext>(In reply to comment #2)
&gt; I wrote a typo by mistake. The perspective function declaration should look
&gt; like this, of course:
&gt; 
&gt;  context.perspective(dx1,dy1, dx2,dy2, dx3,dy3, dx4,dy4)
&gt; 
&gt; The tuples should be given in this sequence: top-left, top-right, bottom-left,
&gt; bottom-right.
&gt; 

I think we can leave perspective transforms to WebGL: &lt;https://cvs.khronos.org/svn/repos/registry/trunk/public/webgl/doc/spec/WebGL-spec.html&gt;
</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>33746</commentid>
    <comment_count>4</comment_count>
    <who name="Axel Dahmen">brille1</who>
    <bug_when>2010-03-22 12:25:30 +0000</bug_when>
    <thetext>Actually, because CSS3 implements the same functionality as the canvas element (which makes me believe that the canvas element becomes redundant then), I have suggested the same functionality to CSS3.

Please find the current discussion at: &quot;comp.infosystems.www.authoring.stylesheets&quot;, &quot;CSS3 Transformation Suggestion: Add additional perspective version to 3D transformations&quot;
- or -
&quot;http://groups.google.com/group/comp.infosystems.www.authoring.stylesheets/browse_thread/thread/389a6a51be2ad903&quot;



In the course of that discussion it became clear that the name &quot;perspective&quot; and &quot;3D&quot; don&apos;t meet the actual goal of this function.

In fact the function prototype I&apos;m suggesting is more general 
than the other canvas transformation function.

With the suggested transform method it is possible to map all existing basic transformation functions - the translate as well as the scale, skew and rotate function, all into one single function.

So I suggest to call it something global like &quot;transform&quot; then.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>33809</commentid>
    <comment_count>5</comment_count>
    <who name="Philip Taylor">excors</who>
    <bug_when>2010-03-23 16:07:09 +0000</bug_when>
    <thetext>There is already a general &quot;transform&quot; function, which can do translations/rotations/scales/skews in a single function. (It&apos;s limited to affine transformations, though, so it can&apos;t do perspective. Would implementations be able to cope with non-affine transformations?)</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>34360</commentid>
    <comment_count>6</comment_count>
    <who name="Ian &apos;Hixie&apos; Hickson">ian</who>
    <bug_when>2010-04-02 01:23:26 +0000</bug_when>
    <thetext>EDITOR&apos;S RESPONSE: This is an Editor&apos;s Response to your comment. If you are satisfied with this response, please change the state of this bug to CLOSED. If you have additional information and would like the editor to reconsider, please reopen this bug. If you would like to escalate the issue to the full HTML Working Group, please add the TrackerRequest keyword to this bug, and suggest title and text for the tracker issue; or you may create a tracker issue yourself, if you are able to do so. For more details, see this document:
   http://dev.w3.org/html5/decision-policy/decision-policy.html

Status: Rejected
Change Description: no spec change
Rationale: This is something we should look at again in a future version, but we&apos;ve got enough trouble getting the browsers to implement the current stuff without adding more complexity already. Baby steps.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>35487</commentid>
    <comment_count>7</comment_count>
    <who name="Axel Dahmen">brille1</who>
    <bug_when>2010-05-07 03:24:02 +0000</bug_when>
    <thetext>Sure. I&apos;m looking forward to upcoming versions of the spec then.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>64769</commentid>
    <comment_count>8</comment_count>
    <who name="Ian &apos;Hixie&apos; Hickson">ian</who>
    <bug_when>2012-02-29 22:23:10 +0000</bug_when>
    <thetext>Punting again for now.

I think the best way to move forward on this would be to get a user agent to implement an experimental version of this, so we can experiment with it before adding it to the spec.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>65330</commentid>
    <comment_count>9</comment_count>
    <who name="Axel Dahmen">brille1</who>
    <bug_when>2012-03-11 21:20:35 +0000</bug_when>
    <thetext>Thank you for putting this on the new schedule.

I can&apos;t provide a sample implementation, I&apos;m afraid. However I can provide a small presentation demonstrating the expected result.

Here&apos;s the URL to the file:

https://skydrive.live.com/?cid=f18aeca352311e71&amp;id=F18AECA352311E71!236&amp;sff=1



While working on the presentation I noticed that a _function_ does not quite yield the most flexibility. There would be a second function necessary to be able to read the currently computed Canvas 2D Context corner position values.

So I&apos;d like to amend my suggestion to not provide a Transformation/Perspective function but to add a Transformation object property to the Context object. (I will continue to use my suggested type/property names for now to be consistent. I do not presume any naming scheme here.)

The Transformation object returned by the 2D Context object should in turn provide four properties representing each of the four Context corners. The type of each of these properties would be TransformationPoint, providing a delta X and a delta Y value.



Here&apos;s the suggested type definition:

Transformation := {&quot;upperLeft&quot;:new TransformationPoint()
                  ,&quot;upperRight&quot;:new TransformationPoint()
                  ,&quot;lowerLeft&quot;:new TransformationPoint()
                  ,&quot;lowerRight&quot;:new TransformationPoint()
                  }

TransformationPoint := {dX:0, dY:0}



Using this definition it would later even be possible to do spline kind of transformations by defining two spline point positions with each TransformationPoint object. These spline point positions would be given relative to the TransformationPoint object&apos;s values.

Given the spline extension, the TransformationPoint class would look like this:

TransformationPoint := {dX:0
                       ,dY:0
                       ,bezierClockwise:new TransformationPoint()
                       ,bezierCounterClockwise:new TransformationPoint()
                       }


RFC
Axel Dahmen</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>82030</commentid>
    <comment_count>10</comment_count>
    <who name="">public-rdfa-wg</who>
    <bug_when>2013-01-24 06:44:37 +0000</bug_when>
    <thetext>This bug was cloned to create HTML WG bug 19053.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>84693</commentid>
    <comment_count>11</comment_count>
    <who name="Ian &apos;Hixie&apos; Hickson">ian</who>
    <bug_when>2013-03-20 00:05:29 +0000</bug_when>
    <thetext>Do any browser vendors want to implement something like this?</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>125994</commentid>
    <comment_count>12</comment_count>
    <who name="Justin Novosad">junov</who>
    <bug_when>2016-04-21 16:09:08 +0000</bug_when>
    <thetext>This was resolved by allowing the current transform to be specified using a 4x4 DOMMatrix, via the DOMMatrixInit dictionary

Fixed by:
https://github.com/whatwg/html/commit/52ef2b19a2f818a032d12c0bc708c058784b9224</thetext>
  </long_desc>
      
      

    </bug>

</bugzilla>