surf=gca;xlim(surf,[-15 +15]);xlabel('x');zlim(surf,[-15 +15]);zlabel('z');ylim(surf,[-15 +15]);ylabel('y');% [1,1,1;4,1,1;4,4,1;1,4,1; 1,1,4;4,1,4;4,4,4;1,4,4]
%vertices=input('inserire i vertici del ploigono \n' );
S.vertices=[1,1,1;4,1,1;4,4,1;1,4,1; 1,1,4;4,1,4;4,4,4;1,4,4];S.faces=[1,2,3,4;1,2,6,5;3,2,6,7;4,3,7,8;4,1,5,8;5,6,7,8];p=patch(S);c = p.CData;p.CDataMapping = 'scaled';p.FaceVertexCData=[1 0 0; 0 1 0 ; 0 0 1 ; 0 1 1 ; 1 0 1 ; 1 1 0 ];
MATLAB: I can’t change polygon faces’s color
facesvertexcdata
Related Question
- How to make this truck move across the bridge in an animation
- How to obtain the pixel information for an image applied to a surface graphics object using IMPIXELINFO in Image Processing Toolbox 5.1 (R14SP3)
- Adding transparency when filling color in plots
- How to rotate the following cube in real time
- How to make a mesh or surface plot that is clear in certain places
- Converting the Domain of an Array
Best Answer