Convert All 2D points to 3D points

Convert All 2D points to 3D points

Anonymous
Not applicable
1,794 Views
5 Replies
Message 1 of 6

Convert All 2D points to 3D points

Anonymous
Not applicable

20210709_194446.jpgI need 2 or more images for visual correspondence.

So I need 2 2D images and their corresponding 3D points.

I know there is 'DeprojectScreenToWorld' but I just return 1 point.

I'm trying to get corresponding all 3D points to 2D points at viewport.

And they must be exported to json or text or something like {(0, 0), (1,2,3)}, {(0,1), (1,1,4)} ....

Is there any way to do this?

0 Likes
1,795 Views
5 Replies
Replies (5)
Message 2 of 6

leeminardi
Mentor
Mentor

I assume you are trying to get 3D coordinates from two projections. If cam1 is viewing the scene perpendicular to the YZ plane and cam2 is similarly positioned but views the scene perpendicular to the XZ plane (with the x axis pointing towards the left)) then cam1 yields y,z coordinates and cam2 x,z coordinates thus yielding the 3D coordinates  The fact that you are setting the view size to approximate a point may allow you to treat the views as axonometric (not perspective).

lee.minardi
0 Likes
Message 3 of 6

Anonymous
Not applicable

Thanks for answering my question. But what I intend is 'getting 3D points which printed to 2D screen' 

 

So one screenshot [100x100] resolution can get at least [100x100] 3D points.

 

I am wondering how 3D world become 2D screen (rendering process) and which 3D points become which 2D points.

0 Likes
Message 4 of 6

leeminardi
Mentor
Mentor

Are you asking about the math that is used to convert 3D point data to a 2D image?

lee.minardi
0 Likes
Message 5 of 6

Anonymous
Not applicable

nop just code or api

0 Likes
Message 6 of 6

leeminardi
Mentor
Mentor

If you are assuming the camera is going to generate a perspective 2D image the procedure is a bit complex.  You can start here for understanding the process.

 

You can simplify the task if you assume an axonometric projection (orthogonal non-perspective). The fourth column of the camera's matrix becomes 0,0,0,1 .  You can simply add a fourth coordinate (1), to the 3D coordinate and multiply it by the 4 x 3 transformation matrix of the orthogonal camera.  The first two coordinates of the result (u,v) will be the 2D projection.

 

 [u, v, w, 1] = [x, y, z,  1]  [  T  ]

lee.minardi
0 Likes