Page 1 of 1

Image perspective transformation

Posted: Wed Feb 07, 2018 12:34 am
by DiegoG
Hello! Thanks for viewing my thread
The thing I want to ask about is what's the best possible way to 'apply' perspective into an image
I've thought a bit about it and the answer I've thought of is to go along the y axis from the bottom to the top of an image and change the width little by little as it goes up -- But I'm not sure how to actually pull it off, I'll be glad to hear any and all suggestions/answers, thanks :D



Also, added to this, this is specifically for terrain in my game. I planned on making two canvases, one slightly larger than the scissor of the drawn screen (The scissor I'm applying for the final product of what's about to be drawn on-screen) to draw the un-transformed piece of terrain that's going to be rendered, and have it transformed and drawn in the second canvas, that's the same size as the scissor. That way it's transformed and drawn on screen efficiently, and on the next frame, both canvases are simply cleared so they can be drawn on again. I'd like to know if there was an easier way/more performance efficient way to do this, thanks in advance!

Re: Image perspective transformation

Posted: Wed Feb 07, 2018 2:47 am
by pgimeno
This might help with the perspective part: https://love2d.org/forums/viewtopic.php?f=5&t=12483 , and in particular https://love2d.org/forums/viewtopic.php ... 27#p212027 which is a port to 0.10.2.