适当变换的3D外观的2D绘图(JAVA) [英] Appropriate Transformation for 3D-looking 2D drawing (Java)
问题描述
我在寻找适当的改造,使2D图像看起来像一个三维图。如果我画一个道上的一张纸平行线,然后从你倾斜页面的顶部了,所以这条道路似乎消失在远方为我所期待的。
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.
我使用Java和想一个合适的API /库。我不相信AffineTransformation实现这一目的。
I'm using Java and would like an appropriate API/library. I don't believe "AffineTransformation" accomplishes this.
推荐答案
您不想要的AffineTransformation,因为这将一如既往preserve平行线,这是你想要在这里不是。
You don't want an AffineTransformation, as that will always preserve parallel lines, which isn't what you want here.
幸运的是,Java高级图像API( javax.media.jai
)有你想要什么,在 <一个形状href="http://download.oracle.com/docs/cd/E17802_01/products/products/java-media/jai/forDevelopers/jai-apidocs/javax/media/jai/PerspectiveTransform.html"相对=nofollow> PerspectiveTransform
类(单击链接文档)。
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屋!