Projecting 3D Model onto 2d plane

﹥>﹥吖頭↗ 提交于 2020-04-10 06:45:49

问题


I have a 3d object, and wish to export it in all direction.Suppose I have home picture and if I project it on 2d plane it only show me something like square but if I change angle it give me different view(In short I want different 2d projection of same 3d object for better visualization).I am looking for python library or algorithm which able to do that.Please ref diagram to get clear idea what i want.enter image description here


回答1:


This can be done with the projective transformation. This are actually just two matrix multiplication and one division. Might be written in one line of Python.

The vector on the right is one of your many 3D vertices of the 3D model. The matrix [r_11 ... t_3] is a rigid transformation and represents the location and orientation of your plane (some people call it camera pose or extrinsic camera parameters). This matrix you are going to change for each individual projection. The matrix [f_x ... 1] defines the projection itself and remains usually unchanged. With your application, it might be possible to just use the identity matrix (therefore, you could ignore it). The last step is scaling the transformed vector in the way, that it lays on the image plane in a distance of z = 1. u_x and u_y are your corresponding 2D coordinates.



来源:https://stackoverflow.com/questions/43849117/projecting-3d-model-onto-2d-plane

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