Module z_media_rotate3d

Calculate the ImageMagick distortion parameters for a 3D rotation.

Copyright © 2021 Marc Worrell

Authors: Marc Worrell (marc@worrell.nl).

Description

Calculate the ImageMagick distortion parameters for a 3D rotation.

Function Index

rotate3d/5Calculate the transformation matrix for the perspective.

Function Details

rotate3d/5

rotate3d(Width::non_neg_integer(), Height::non_neg_integer(), Roll::number(), Tilt::number(), Pan::number()) -> {ok, string()} | {error, term()}

Calculate the transformation matrix for the perspective. Translate the corner points of the image to the arguments for the ImageMagick distort function. This code has been derived from http://www.fmwconcepts.com/imagemagick/3Drotate/index.php

Here we don't scale the image, the image is rotated from the center of the image, and we use a fixed viewing point that is compatible with the viewing point used in the mod_image_edit css3 transformations.


Generated by EDoc