% Archana Gupta
% Project
% function to find normals of triangles of simplified mesh  

function normal = findnormals(vertices, faces)
   normal = zeros(size(faces, 1), 3);
   for i = 1: size(faces, 1)
      pt1 = vertices(faces(i, 1), :);
      pt2 = vertices(faces(i, 2), :);
      pt3 = vertices(faces(i, 3), :);
      normal(i,:) = cross(pt2-pt1, pt3-pt2);
   end
   
  