Adventure Game Studio

AGS Support => Advanced Technical Forum => Topic started by: Dualnames on Fri 07/06/2019 03:38:39

Title: SKEW Code (Solved)
Post by: Dualnames on Fri 07/06/2019 03:38:39
https://www.google.com/url?q=https://stackoverflow.com/questions/50149907/imagemagick-skew-image-with-4-x-y-coordinates&sa=D&source=hangouts&ust=1559960173965000&usg=AFQjCNG9LfZr89A8zYRZwyZRw3YNPByfPw


I'm trying to do a simple skew, where u take an image adjust its 4 points and the image gets skewed accordingly. Unfortunately, I've been unable to get an algorithm i can work with, anybody have any ideas?
Title: Re: SKEW Code
Post by: tzachs on Fri 07/06/2019 05:07:39
Inkscape has a "skew" feature, I think their code for that is here, if that helps: https://gitlab.com/inkscape/inkscape/blob/master/src/ui/tool/transform-handle-set.cpp#L510
Title: Re: SKEW Code
Post by: Dualnames on Sat 08/06/2019 00:00:56
It's actually projective transformation that I'm trying to accomplish, but I can't seem to be able to find a usable code.
Title: Re: SKEW Code
Post by: eri0o on Sat 08/06/2019 02:29:35
do you need to do this on every frame or only once in a while? I think this can be accomplished with matrices and get pixel, draw pixel, but won't be fast.

I would implement this math: http://www.senocular.com/flash/tutorials/transformmatrix/
Title: Re: SKEW Code
Post by: Khris on Thu 20/06/2019 14:16:29
This might help ;) https://www.adventuregamestudio.co.uk/forums/index.php?topic=41649.0
Title: Re: SKEW Code
Post by: Dualnames on Fri 21/06/2019 06:41:10
Omg, yes, thank you Khris!!