Effacer les filtres
Effacer les filtres

How to set Color Data for Interpolated shading?

1 vue (au cours des 30 derniers jours)
Julius
Julius le 18 Juin 2012
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()?

Réponse acceptée

Julius
Julius le 23 Juin 2012
fill3() works perfectly

Plus de réponses (0)

Community Treasure Hunt

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

Start Hunting!

Translated by