Matlab以编程方式定义图形的缩放和旋转

时间:2019-05-19 19:42:41

标签: matlab figure

我正在尝试显示一个背景中没有多余“白色”区域的图形。 即我有下图:
enter image description here
(多余的背景标有蓝色)

我希望显示该图时的结果更像是
enter image description here
这是我用来绘制图形的代码

function plot_scalar_map(M, f, diffuse_strength)

if nargin==2
    diffuse_strength=0.6;
end

trisurf(M.TRIV,M.VERT(:,1),M.VERT(:,2),M.VERT(:,3),double(f),...
    'SpecularStrength',0.15,...
    'DiffuseStrength',diffuse_strength);
axis equal
shading interp
rotate3d on
set(gca,'clipping','off')
xlabel('X')
ylabel('Y')
zlabel('Z')

end



mesh_0 = load('M0');
mesh_1 = load('M1');

matches = load('X.mat'));

colors = create_colormap(mesh_1,mesh_1);
figure;
subplot(1,2,1); colormap(colors);
plot_scalar_map(mesh_1,[1: size(mesh_1.VERT,1)]');freeze_colors;title('Target');

subplot(1,2,2); colormap(colors(matches,:));
plot_scalar_map(mesh_0,[1: size(mesh_0.VERT,1)]');freeze_colors;title('Source');

0 个答案:

没有答案