3D to 2D projection

9 vues (au cours des 30 derniers jours)
Javad Hashemi
Javad Hashemi le 5 Déc 2013
Commenté : Arunkumar Rathinam le 10 Août 2019
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 commentaire
Arunkumar Rathinam
Arunkumar Rathinam le 10 Août 2019
any updates on this.... on how you solved the problem ??.. any code or link would be really helpful.

Connectez-vous pour commenter.

Réponses (0)

Community Treasure Hunt

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

Start Hunting!

Translated by