3 ms·
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 improvem
by mysterydip 5y ago
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.
- JKCalhoun 5y agoHad 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.
- rikroots 5y agoI, 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. [1] - https://github.com/whatwg/html/issues/5620 https://github.com/whatwg/html/issues/5620 [2] - https://scrawl-v8.rikweb.org.uk/demo/dom-015.html https://scrawl-v8.rikweb.org.uk/demo/dom-015.html
- mysterydip 5y agoyes correct. I've seen a couple done but like you and the other poster said they're slower than ideal.
- mysteryDate 5y agoAHHHHHH! 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.
- mysterydip 5y agoglad to see I'm not alone. Sucks to hear the outcome, thanks for trying. Maybe someday :)
- mysteryDate 5y agoLook the proposal's still here! https://github.com/fserb/canvas2D/blob/master/spec/perspective-transforms.md 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.
- archerx 5y agoI want this so badly, unfortunately I don’t have an army of web devs at my disposal :(
- archerx 5y agoThey should just rename Safari to “Disappointment, the browser”, it truly is the reason we can’t have nice things.