Re:It's always been you, Canvas2D
by mysterydip on Friday March 04, 2022 @07:59AM
(#30554051)
I'd like if there was a "mode 7" style affine transformation available, but I understand my needs are niche. Still, nice to see some of the performance improvements and that reset function.
[ Parent
| on HN ]
Re:It's always been you, Canvas2D
by mysteryDate on Friday March 04, 2022 @09:19AM
(#30555083)
AHHHHHH! We wanted to add this so badly! Wrote the code and the spec and everything!
Unfortunately Safari said it would be too much effort on their end to change the 2x3 matrices on the backend to 4x4 matrices to support this.
They should just rename Safari to “Disappointment, the browser”, it truly is the reason we can’t have nice things.
Re:It's always been you, Canvas2D
by mysterydip on Friday March 04, 2022 @09:45AM
(#30555489)
glad to see I'm not alone. Sucks to hear the outcome, thanks for trying. Maybe someday :)
Re:It's always been you, Canvas2D
by mysteryDate on Friday March 04, 2022 @09:58AM
(#30555717)
Look the proposal's still here!
https://github.com/fserb/canvas2D/blob/master/spec/perspecti...
If you raise an army of angry webdevs to yell at other browser implementers, I would be so very happy.
I want this so badly, unfortunately I don’t have an army of web devs at my disposal :(
Had to look that one up.
Seems like you could implement your own in code. It would not be fast though — having to walk each pixel in the canvas buffer, apply the transform to grab a pixel from another buffer, then assign the transformed buffer back to the canvas.
I, too, had to look it up. This is about adding a (pseudo) perspective effect to the 2D canvas yes? There is an open issue in the whatwg/html repo[1] asking for this functionality - I have no idea whether the request will be taken forward by any browsers.
The current solution is to "roll your own" functionality. It is doable - for instance I've added such functionality to my canvas library[2]. The results work, but are slower than ideal.
Re:It's always been you, Canvas2D
by mysterydip on Friday March 04, 2022 @09:02AM
(#30554820)
yes correct. I've seen a couple done but like you and the other poster said they're slower than ideal.