7

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

Frank Shearar
  • 17,012
  • 8
  • 67
  • 94
MartinW
  • 4,966
  • 2
  • 24
  • 60
  • Additionally, you should ask in the Pharo mailing list. – Sebastian N. Feb 25 '13 at 23:05
  • 1
    I asked the Cairo list about this a number of years ago for the VisualWorks port. They said there is none. Though there was some interest on the developers' part in providing a means to do so for ImageSurface patterns. But I don't think it's ever happened. – Travis Griggs Feb 26 '13 at 16:09

2 Answers2

6

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.

Igor Stasenko
  • 1,037
  • 5
  • 8
2

I was also always interested in this kind of transformation.

Not only in Pharo, but also other platforms like Java (Java2D), or the HTML5 canvas.

So far, my findings point out that it does not seem to be possible.

It seems that these libraries simply were not developed with 3D in mind, or 3D support. Everywhere I looked I the 2 suggestions were mostly:

  • this should be done using OpenGL
  • implement the transformation on top of Cairo/Java2D/canvas

It's not my intention to sound negative, shuts wanted to share my search results and maybe save you some time.

Sebastian N.
  • 1,962
  • 15
  • 26