function iso_a = surfalign(iso_vf,iso_t,vt,dt)

iso_a.faces = iso_vf.faces;
vert = iso_vf.vertices;

% translation

iso1_mass = ones(size(vert,1),1)*mean(vert);
vert = vert - iso1_mass;

% rotation

[vert_a,v,d] = rotation(vert,vt,dt);
iso_a.vertices = vert_a;

% plot after alignment

close all
title('rotation (red: template, blue: current)')
figure_mesh(iso_t,vt,dt,'red','none');
hold on;
figure_mesh(iso_a,v,d,'blue','none');
hold off;
