Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to make a perspective transformation with Athens/Cairo in Pharo Smalltalk

I found affine transformation functionality (rotate, shear, translate, scale) in Athens/Cairo in Pharo Smalltalk.

I am looking for a perspective transformation. Is this possible at all? At least there seem to be no convenience methods for this in the Cairo API.

perspective transformation

like image 873
MartinW Avatar asked Feb 25 '13 10:02

MartinW


1 Answers

There is no perspective transformation, because matrices used in computation is 2x3 affine matrices, which cannot produce such transformation (no combination of scale/rotation on 2-D coordinate space can produce such result). OpenGL uses full 4x4 matrix for coordinate transformations (well, usually it is 3x3 + translation column), but it is enough to create transformations like perspective projection.

like image 141
Igor Stasenko Avatar answered Nov 11 '22 12:11

Igor Stasenko