Hello! I am attempting to do some ~graphics programming.~
What I am trying to do is a SNES Mode 7 perspective effect: take an image from a canvas and scale it to a trapezoid shape for pseudo-3D.
This type of thing.
What I am doing is: first scale down the image by a scale factor vs.
img:src.copy[] img.scale[1,vs]
And then go line-by-line and scale the image horizontally by a scale factor that starts at 1 at the top and goes to hs at the bottom.
each y in range imgy temp:img.copy[(0,y) (imgx,1)] temp.scale[((y/imgy)*(hs-1))+1,1] img.paste[temp.copy[( (temp.size[0]-imgx)/2 ,0) (imgx,1)] (0,y) 1] end
I tried scrolling a canvas with Zazz and scaling that image onto another canvas in real time.
And this seems to work!


...But it doesn't run so well in web Decker.

(Hopefully you can tell from the gif.)
It seems like there's probably a more efficient way of doing this, maybe with matrix math, but I can't figure it out.
Thank you.

