Image rotation in 3D space around Y axis

爷,独闯天下 提交于 2020-01-14 02:39:08

问题


I have a BufferedImage and I want to rotate the image (Picture) around the Y axis in Java with theta angle not affine transform. The rotation will be like the image below (the rectangle will be an image).

I can do this by rotating each pixel of the image and drawing the image. Because I have to rotate a lot of images, I don't think this is the best idea.

How I will do this transformation?

Thanks for your help.


回答1:


Generally, you'll want to find the inverse transform from your output pixel space into the input pixel's space. You then iterate over the output pixels, transforming them into the input space and sampling the input image. The Wikipedia entry on Perspective Projection shows how to make a rotation matrix for the Y axis. If all you're doing is rotating around the Y axis, you can simply reverse the angle to get the inverse transformation (assuming your image is centered at the origin).



来源:https://stackoverflow.com/questions/13741571/image-rotation-in-3d-space-around-y-axis

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!