Serious display defects occurred when using "uiaxes"

조회 수: 3 (최근 30일)
Heran Wang
Heran Wang 2021년 7월 3일
답변: Heran Wang 2021년 12월 22일
I used "uiaxes" to display 3D voxels on an app.
However, I found a serious problem.
As shown in the following picture, the left is drawn in a "figure", the right one is drawn in the "uiaxes" in the app.
As we can see, the right one (in the uiaxes) has a display problem, which confused me a lot.
I used the exactly the same data to draw these two picture. However, the one in the uiaxes have some serious display defects, Specifically, some parts of the yellow shell are not displayed, so that we can see the inner part through the shell.
I used "surface()" function:
surface(app.UIAxes, [cx(1,1,jz),cx(end,1,jz)+d],[cy(1,1,jz),cy(1,end,jz)+d], zeros(2)+cz(1,1,jz),...
permute(cDataXY,[2,1,3]), 'FaceColor','texturemap','FaceAlpha', 'texturemap', 'EdgeColor', 'none', 'AlphaDataMapping', 'none',...
'AlphaData',squeeze(alphaData(:,:,jz))','AmbientStrength',ambientStrength, 'FaceLighting',faceLighting,...
'SpecularStrength',specularStrength,'SpecularExponent',1, 'SpecularColorReflectance', 0);
I have no idea what happened here. I am wondering if there is something wrong with my settings.
I feel that the phenomenon is related to the attribute called "SortMethod ", because when I change the attribute from 'depth' to 'childorder', the defect will become more serious.
Really need some help here.
(MATLAB 2021a)
  댓글 수: 1
Heran Wang
Heran Wang 2021년 7월 3일
2021-07-03 15:59
I think I have found something.
Different surface() order will indicate different reflect.
To draw a voxel, I should draw planes in XY/YZ/XZ, respectively. If I change the order (as shown in the following picture), the phenomenon changed.
I believe MATLAB failed to handle the Order for rendering objects in uiaxes. Is this means that the attribute called "SortMethod " failed to work? Or did I do something wrong?

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

답변 (1개)

Heran Wang
Heran Wang 2021년 12월 22일
The problem is totally solved in MATLAB 2021b!
I run the exact same code in 2021a and 2021b, and the display is perfect in 2021b.
Thank you so much for the optimation.
I love MATLAB.

카테고리

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

제품


릴리스

R2021a

Community Treasure Hunt

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

Start Hunting!

Translated by