Renu
Renu

Reputation: 35

Projecting 3D Model onto 2d plane

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

Upvotes: 0

Views: 7323

Answers (1)

Adrian Schneider
Adrian Schneider

Reputation: 1507

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. enter image description here

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.

Upvotes: 2

Related Questions