rotate 3D plane to a new 2d coordinate system

조회 수: 28 (최근 30일)
pablo
pablo 2013년 7월 10일
편집: Johannes 2018년 1월 10일
Hello, I have been looking for this relatively simple issue but I haven't found a simple solution.
I have extracted a plane in 3D from a visualization software, so I have a matrix of coordinates: Coor_3D= [x1 x2 x3];.
As all the points are lying on the same plane, I was wondering how can I transform the above matrix to obtain a simple one in 2D, i.e = Coor_2D=[x1' x2' 0];
Thanks

채택된 답변

Matt J
Matt J 2013년 7월 10일
편집: Matt J 2013년 7월 10일
Once you decide on a target plane, find the axis where the targe tplane intersects your current plane. Then rotate around that axis using

추가 답변 (2개)

Elena Figal
Elena Figal 2018년 1월 9일
Hello, I tried to recover the original 3D points from the transformation by using the same matrix T and a set of 2D points with a rows of zero and a row of 1, but my new 3D points are different from the originals, could you please help me?
  댓글 수: 1
Johannes
Johannes 2018년 1월 10일
편집: Johannes 2018년 1월 10일
I want to know the same: Please open a new issue and let's see if someone finds the answer. Please let me know if you find something.
I am this far now:
Matt kindig does:
T = [unitx(:), unity(:), unitz(:), origin(:); 0 0 0 1];
C = [pnts, ones(N,1)]
Coor_2D = T \ C'
To recover pnts out of Coor_2D, you have to solve the equation for C and then extract pnts. I think it should be:
C = (T*Coor_2D)'
But this does not result in the correct points...any other idea?
Edit: I found the solution!
My mathematical solution was right, you just have to handle Coor_2D correctly to transform it backwards. Here's the code. You just need 2d-points (twoDpnts), the Transformation T and a row of zeros (zeros(size(twoDpnts,1)) and a row of ones (ones(size(twoDpnts,1),1)).
Coor_2D_backwards = [twoDpnts zeros(size(twoDpnts,1),1) ones(size(twoDpnts,1),1)]'
C = (T*Coor_2D_backwards)'
pnts = C(:,1:3)
Best regards

댓글을 달려면 로그인하십시오.

카테고리

Help CenterFile Exchange에서 Interpolation에 대해 자세히 알아보기

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by