How to set Color Data for Interpolated shading?

1 次查看(过去 30 天)
I wrote a function to visualize some values on an object made of 24 brick elements:
function plottings(quantity)
load('Mesh.mat', 'nds','elms')
load('Specifications.mat','ELEMENT')
x=nds(:,1);
y=nds(:,2);
z=nds(:,3);
vertex_matrix =[x y z];
faces_matrix=[];
for i=1:ELEMENT
face = [elms(i,1) elms(i,2) elms(i,6) elms(i,5);
elms(i,2) elms(i,3) elms(i,7) elms(i,6);
elms(i,3) elms(i,4) elms(i,8) elms(i,7);
elms(i,4) elms(i,1) elms(i,5) elms(i,8);
elms(i,1) elms(i,2) elms(i,3) elms(i,4);
elms(i,5) elms(i,6) elms(i,7) elms(i,8)];
faces_matrix= vertcat(faces_matrix,face);
end
FaceVertexCData=quantity;
patch('Vertices',vertex_matrix,'Faces',faces_matrix,...
'FaceVertexCData',hsv(8),'FaceColor','interp')
view(3)
axis equal
end
...but Matlab doesn't want to interpolate shading and writes: Warning: Color Data is not set for Interpolated shading How should I write the code to pass that warning? or...what should I use instead of patch()?

采纳的回答

Julius
Julius 2012-6-23
fill3() works perfectly

更多回答(0 个)

类别

Help CenterFile Exchange 中查找有关 Polygons 的更多信息

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by