필터 지우기
필터 지우기

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 CenterFile Exchange에서 Polygons에 대해 자세히 알아보기

Community Treasure Hunt

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

Start Hunting!

Translated by