7

我在 Pharo Smalltalk 的雅典/开罗发现了仿射变换功能(旋转、剪切、平移、缩放)。

我正在寻找透视变换。这可能吗?至少在 Cairo API 中似乎没有方便的方法。

透视变换

4

2 回答 2

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.

于 2013-02-26T12:04:45.040 回答
2

我也一直对这种转变很感兴趣。

不仅在 Pharo 中,还有其他平台,如 Java (Java2D) 或 HTML5 画布。

到目前为止,我的发现指出这似乎是不可能的。

似乎这些库根本没有考虑到 3D 或 3D 支持。我到处找我的两个建议主要是:

  • 这应该使用 OpenGL 来完成
  • 在 Cairo/Java2D/canvas 之上实现转换

我无意听起来消极,关闭想分享我的搜索结果,也许可以节省你一些时间。

于 2013-02-25T23:04:44.990 回答