フィルターのクリア

How to set Color Data for Interpolated shading?

1 回表示 (過去 30 日間)
Julius
Julius 2012 年 6 月 18 日
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 Center および File ExchangePolygons についてさらに検索

Community Treasure Hunt

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

Start Hunting!

Translated by