sustaining_gazes/matlab_version/face_validation/WriteOutTriangulation.m

30 lines
837 B
Mathematica
Raw Normal View History

2016-04-28 21:40:36 +02:00
function WriteOutTriangulation(locationTxt, locationMlab, faceCheckers)
addpath('..\PDM_helpers\');
triangulationFile = fopen(locationTxt, 'w');
views = numel(faceCheckers);
fprintf(triangulationFile, '# Number of triangulations\r\n%d\r\n', views);
for i = 1:views
fprintf(triangulationFile, '# Triangulation %d\r\n', i);
triangulation = faceCheckers(i).triangulation;
% swap around for clockwise convention in openGL
tmp = triangulation(:,2);
triangulation(:,2) = triangulation(:,1);
triangulation(:,1) = tmp;
fprintf(triangulationFile, '# triangulation \r\n');
writeMatrix(triangulationFile, triangulation, 4);
end
fclose(triangulationFile);
save(locationMlab);
end