This is an archived snapshot of W3C's public bugzilla bug tracker, decommissioned in April 2019. Please see the home page for more details.
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
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.
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.
(In reply to comment #2) > 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. > I think we can leave perspective transforms to WebGL: <https://cvs.khronos.org/svn/repos/registry/trunk/public/webgl/doc/spec/WebGL-spec.html>
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: "comp.infosystems.www.authoring.stylesheets", "CSS3 Transformation Suggestion: Add additional perspective version to 3D transformations" - or - "http://groups.google.com/group/comp.infosystems.www.authoring.stylesheets/browse_thread/thread/389a6a51be2ad903" In the course of that discussion it became clear that the name "perspective" and "3D" don't meet the actual goal of this function. In fact the function prototype I'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 "transform" then.
There is already a general "transform" function, which can do translations/rotations/scales/skews in a single function. (It's limited to affine transformations, though, so it can't do perspective. Would implementations be able to cope with non-affine transformations?)
EDITOR'S RESPONSE: This is an Editor'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've got enough trouble getting the browsers to implement the current stuff without adding more complexity already. Baby steps.
Sure. I'm looking forward to upcoming versions of the spec then.
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.
Thank you for putting this on the new schedule. I can't provide a sample implementation, I'm afraid. However I can provide a small presentation demonstrating the expected result. Here's the URL to the file: https://skydrive.live.com/?cid=f18aeca352311e71&id=F18AECA352311E71!236&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'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's the suggested type definition: Transformation := {"upperLeft":new TransformationPoint() ,"upperRight":new TransformationPoint() ,"lowerLeft":new TransformationPoint() ,"lowerRight":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'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
This bug was cloned to create HTML WG bug 19053.
Do any browser vendors want to implement something like this?
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