3D 外观 2D 绘图的适当转换 (Java) [英] Appropriate Transformation for 3D-looking 2D drawing (Java)
问题描述
我正在寻找适当的转换,使 2D 图像看起来像 3D 绘图.如果我在一张纸上用平行线画一条道路",然后将页面顶部向远离你的方向倾斜,让道路看起来消失在远处,这就是我要找的.p>
我正在使用 Java 并且想要一个合适的 API/库.我不相信AffineTransformation"能做到这一点.
您不想要 AffineTransformation,因为它会始终保留平行线,这不是您在这里想要的.
幸运的是,Java Advanced Imaging API (javax.media.jai
) 正是您想要的,其形式为 PerspectiveTransform
类(单击该链接获取文档).
I'm looking for the appropriate transformation to make a 2D image look like a 3D drawing. If I draw a "road" with parallel lines on a sheet of paper, and then tilt the top of the page away from you, so that the road appears to be disappearing into the distance is what I am looking for.
I'm using Java and would like an appropriate API/library. I don't believe "AffineTransformation" accomplishes this.
You don't want an AffineTransformation, as that will always preserve parallel lines, which isn't what you want here.
Luckily the Java Advanced Imaging API (javax.media.jai
) has exactly what you want, in the shape of the PerspectiveTransform
class (click that link for docs).
这篇关于3D 外观 2D 绘图的适当转换 (Java)的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!