필터 지우기
필터 지우기

2D image in 3D plot with partial transparency

조회 수: 2 (최근 30일)
Kyle Wang
Kyle Wang 2015년 4월 2일
I used surf to plot a 2D matrix as a 3D model, then I want to place imagesc(matrix) on top of this 3D model.Moreover, I want to set part of the 2D image transparent. I understand the texturemap trick, but such method doesn't allow me to set alpha data to my 2D image. Any suggestion, many thanks.
surf(sampleMatrix); hold on
xLimit = xlim;
yLimit = ylim;
alphaMap = zeros(size(sampleMatrix));
alphaMap(:) = 0.5;
alphaMap(sampleMatrix == 5) = 0;
surf([xLimit(1) xLimit(2)],[yLimit(1) yLimit(2)],repmat(70, [2 2]),...
sampleMatrix, 'Facecolor','texturemap', 'alphadata', alphaMap);
The last line doesn't work :(

답변 (0개)

카테고리

Help CenterFile Exchange에서 Lighting, Transparency, and Shading에 대해 자세히 알아보기

Community Treasure Hunt

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

Start Hunting!

Translated by