How to draw a patch with different front-face and back-face colors?

조회 수: 4 (최근 30일)
Dmitry
Dmitry 2013년 12월 3일
편집: Agustín Trujillo-Pino 2015년 9월 4일
Consider drawing a patch, say
patch([0 1 1], [0 0 1], [1 2 3], 1).
I want the patch sides to be of different color: say, "red" when I look at its front-face and "blue" when I look at its back side. Is it possible?
Or maybe it's possible to switch on the "back-face culling" in MATLAB?
  댓글 수: 2
Alec Jacobson
Alec Jacobson 2015년 3월 23일
I'd also like to know if this is possible.
Agustín Trujillo-Pino
Agustín Trujillo-Pino 2015년 9월 4일
편집: Agustín Trujillo-Pino 2015년 9월 4일
You need to create your own callback every time the user moves the mouse to rotate, and in that callback you compute what faces are front-facing or back-facing to the camera, and set the corresponding color for each one.

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

답변 (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