Java图像转换
I need to create 3d depth effect for my image. Number 1 is what I have and number 2 is shape where I want to transform number 1. So is there any method for that in Java standard graphics libraries or some other open source libraries?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
使用
AffineTransform
类无法完成此操作。请参阅维基百科关于仿射变换的文章:您需要的是某种形式的透视变换。来自 http:// java.sun.com/products/java-media/jai/forDevelopers/jai-apidocs/javax/media/jai/PerspectiveTransform.html
来自 http://answers.google.com/answers/threadview/id/515829.html
This can not be done using the
AffineTransform
class. See Wikipedia article on affine transformation:What you need is some form of perspective transform. From http://java.sun.com/products/java-media/jai/forDevelopers/jai-apidocs/javax/media/jai/PerspectiveTransform.html
From http://answers.google.com/answers/threadview/id/515829.html
如果您想在 3D 中进行大量快速绘图,那么我建议您研究 3D 渲染解决方案,例如 OpenGL / JOGL。
如果这只是一个快速的一次性转换,那么您可以通过
If you want to do a lot of fast drawing in 3D then I'd suggest looking into a 3D rendering solution such as OpenGL / JOGL.
If it is just a quick one-off transformation then you can simulate this pretty easily by