3D to 2D projection
이전 댓글 표시
Hi fellow Matlabers,
I have xyz coordinate of vertices of a 3D object. I am attaching a plot of the object which I created using the following code:
patch(P1X,P1Y,P1Z,'c','FaceAlpha',0.75);
My objective is to have this shell opened (flattened or projected) on a plane. Similar to what is done with earth map (Map projection in Matlab Mapping toolbox here). However, I think their algorithms are based on the assumption that earth is a homogeneous perfect sphere or ellipsoid which is not my case. Additionally, they used specific geodata formats.

I have tried using viewmtx command but it only gives a 2D projection from camera viewing angle. This does not do the job:
A = viewmtx(-37.5,30);
[m,n] = size(x);
x4d = [x(:),y(:),z(:),ones(m*n,1)]';
x2d = A*x4d;
x2 = zeros(m,n); y2 = zeros(m,n);
x2(:) = x2d(1,:);
y2(:) = x2d(2,:);
figure
scatter(x2,y2)

Any help and suggestion would be highly appreciated.
Cheers, Javad
댓글 수: 1
Arunkumar Rathinam
2019년 8월 10일
any updates on this.... on how you solved the problem ??.. any code or link would be really helpful.
답변 (0개)
카테고리
도움말 센터 및 File Exchange에서 Coordinate Reference Systems에 대해 자세히 알아보기
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!