Render Image Perspective

Core

Member
Nov 10, 2016
356
138
I am currently writing a camera render script in imagic php rather than GD as I will eventually port this script into a library so the emulator can parse the data directly without having to send a web request as the extension also has a wrapper for .NET, Java, etc.

However, I can't seem to distort the images perspective correctly. Here is what it's doing xD!



My perspective distortion

Code:
$base_texture->distortImage(Imagick::DISTORTION_PERSPECTIVE, array(
                    $plane["cornerPoints"][0]["x"],
                    $plane["cornerPoints"][0]["y"],
                   
                    $plane["cornerPoints"][1]["x"],
                    $plane["cornerPoints"][1]["y"],
                   
                    $plane["cornerPoints"][3]["x"],
                    $plane["cornerPoints"][3]["y"],
                   
                    $plane["cornerPoints"][2]["x"],
                    $plane["cornerPoints"][2]["y"]
               
                ), true);

Here is output without distortion
 

Users who are viewing this thread

Top