Problem with plotting individual CData on triangular mesh
이전 댓글 표시
I am having an issue with plotting a triangular surface with individual CData face colors. My CData contains NaN, as well as integer values (non scaled).
Here is the code I am using:
figure;
f1 = patch('Faces',faces,'Vertices',vertices);
set(f1,'FaceColor','flat','FaceVertexCData',CData,'CDataMapping','scaled');
When the figure window opens, I see an uncolored wire mesh of my object.
Interestingly, if I add the following lines:
hold on;
plot3(vertices(:,1), vertices(:,2), vertices(:,3), 'k.')
All of a sudden my colored faces show up, but I don't want the plotted vertices! If I turn them off manually using the property editor, my face colors disappear.
Does anyone know what's going on here? What am I missing?
Thanks, Erin
답변 (2개)
Titus Edelhofer
2011년 9월 1일
Hi Erin,
just guessing, since I have no MATLAB available right now. It could be the renderer: try
set(gcf, 'renderer', 'zbuffer')
after creating the patch....?
Titus
카테고리
도움말 센터 및 File Exchange에서 Graphics Performance에 대해 자세히 알아보기
제품
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!