0001
0002
0003
0004
0005 FV = sphere_tri('ico',3,[],0);
0006
0007
0008
0009 facecolor = [.7 .7 .7];
0010 figure
0011 Hp = patch('faces',FV.faces,'vertices',FV.vertices,...
0012 'facecolor',facecolor,'facealpha',0.8,'edgecolor',[.8 .8 .8]);
0013 camlight('headlight','infinite'); daspect([1 1 1]); axis vis3d; axis off
0014 material dull; rotate3d
0015 hold on
0016
0017 f = 10;
0018 vertex_index1 = FV.faces(f,1);
0019 vertex_index2 = FV.faces(f,2);
0020 vertex_index3 = FV.faces(f,3);
0021 vertex1 = FV.vertices(vertex_index1,:);
0022 vertex2 = FV.vertices(vertex_index2,:);
0023 vertex3 = FV.vertices(vertex_index3,:);
0024
0025 plot3(vertex1(1),vertex1(2),vertex1(3),'ro')
0026 plot3(vertex2(1),vertex2(2),vertex2(3),'go')
0027 plot3(vertex3(1),vertex3(2),vertex3(3),'bo')
0028
0029 vertNormals = get(Hp,'vertexnormals');
0030
0031 quiver3(vertex1(1),vertex1(2),vertex1(3),...
0032 vertNormals(vertex_index1,1),vertNormals(vertex_index1,2),vertNormals(vertex_index1,3));
0033
0034 view(3)
0035 rotate3d