1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41
| x=Tab(:,1);
y=Tab(:,2);
z=Tab(:,3);
figure
tri = delaunay(Tab(:,1),Tab(:,2),Tab(:,3))
B = trimesh(tri,x,y,z);
axis equal
%% Projection sur un plan
y(:) =12;
tri = delaunay(x,z);
figure
Bb = trimesh(tri,x,y,z);
axis equal
axis tight
%% Superposition des images
rgb = imread('visage-homme.jpg','jpg');
xp = x;
yp = ones(30,1)*12;
zp = z;
tri = delaunay(xp,zp);
xs = [1 size(rgb,2) ; 1 size(rgb,2)];
ys = ones(2)*12;
zs = [size(rgb,1) size(rgb,1) ; 1 1];
figure(1)
surface(xs,ys,zs,'facecolor','texturemap','cdata',rgb);
hold on
patch('vertices',[xp(:) yp(:) zp(:)],'faces',tri,'facecolor','none','edgecolor','b','LineWidth',2)
grid on
view(3) |
Partager