3D to 2D projection

20 Ansichten (letzte 30 Tage)
Javad Hashemi
Javad Hashemi am 5 Dez. 2013
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 Kommentar
Arunkumar Rathinam
Arunkumar Rathinam am 10 Aug. 2019
any updates on this.... on how you solved the problem ??.. any code or link would be really helpful.

Melden Sie sich an, um zu kommentieren.

Antworten (0)

Community Treasure Hunt

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

Start Hunting!

Translated by