Serious display defects occurred when using "uiaxes"

3 visualizzazioni (ultimi 30 giorni)
Heran Wang
Heran Wang il 3 Lug 2021
Risposto: Heran Wang il 22 Dic 2021
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 Commento
Heran Wang
Heran Wang il 3 Lug 2021
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?

Accedi per commentare.

Risposte (1)

Heran Wang
Heran Wang il 22 Dic 2021
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.

Prodotti


Release

R2021a

Community Treasure Hunt

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

Start Hunting!

Translated by