3-D Visualization |
Example -- Specifying Flat Edge and Face Coloring
These statements create a square patch.
v = [0 0 0;1 0 0;1 1 0;0 1 0]; f = [1 2 3 4]; fvc = [1 0 0;0 1 0;1 0 1;1 1 0]; patch('Vertices',v,'Faces',f,'FaceVertexCData',fvc,... 'FaceColor','flat','EdgeColor','flat',... 'Marker','o','MarkerFaceColor','flat')
The Faces
property value, [1 2 3 4]
, determines the order in which MATLAB connects the vertices. In this case, the order is red, green, magenta, and yellow. If you change this order, the results can be quite different. For example, specifying the Faces
property as
changes the order to yellow, magenta, green, and red. Note that changing the order not only changes the color of the edges, but also the color of the face, which is the color of the first vertex specified.
Patch Edge Coloring | Coloring Edges with Shared Vertices |
© 1994-2005 The MathWorks, Inc.