How to put names on the six faces of a cube so that they do not disappear in the cube?

조회 수: 2 (최근 30일)
Vertices = [0 0 0; 1 0 0; 1 1 0; 0 1 0; 0 0 1; 1 0 1; 1 1 1; 0 1 1];
Faces = [1 2 6 5; 2 3 7 6; 3 4 8 7; 4 1 5 8; 1 2 3 4; 5 6 7 8]
h = patch('Vertices',Vertices,'Faces',Faces, 'FaceVertexCData',hsv(6),'FaceColor','flat')
view(3); axis square
for k = 1:6, text(mean(Vertices(Faces(k,:),1)), ... mean(Vertices(Faces(k,:),2)), ... mean(Vertices(Faces(k,:),3)), ... num2str(k), 'Fontsize',44) end return

답변 (1개)

Thorsten
Thorsten 2016년 7월 25일
  댓글 수: 5
Stephen23
Stephen23 2016년 7월 25일
@Kees Roos: Rather than placing the text on the cube surface, you could specify the location of the text a little further away from the center of the cube. Then the cube will not interfere with the text.
Kees Roos
Kees Roos 2016년 7월 25일
Dear Stephen, I understand, but I am looking for a better solution.

댓글을 달려면 로그인하십시오.

카테고리

Help CenterFile Exchange에서 Annotations에 대해 자세히 알아보기

제품

Community Treasure Hunt

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

Start Hunting!

Translated by