How to set the shadow in the trimesh figure?

7 vues (au cours des 30 derniers jours)
wei zhang
wei zhang le 31 Juil 2020
Modifié(e) : wei zhang le 31 Juil 2020
I am trying to display surface mesh of the brain in Matlab. I used the delaunayTriangulation object and trimesh function. I need to show the 3D effect with some shadow on the mesh. So I could get some specific point coordinates on it. How to set the shadows?
I want to get the effect like below, which is from Meshlab. It doesn't plot the edges.
My matlab codes and figure is as below.
trimesh(TR,'FaceColor',ones(3,1)*0.9,'LineStyle','none');
set(gca, 'color', 'k');
I don't have the shadow on the surface to show the 3D effect.
Thank you for any suggestions.
----------------------Edited 1st time-------------------
I test some codes with lighting. Even though I don't know how to give an uniform light from every direction. I made some progress. How many camlight could make an all-sided view with shadow.
trimesh(TR,'FaceColor',ones(3,1)*0.9,'LineStyle','none');
set(gca, 'color', 'k');
lighting gouraud;
a1 = camlight('right');
a2 = camlight('left');
a3 = camlight('headlight');

Réponses (0)

Catégories

En savoir plus sur Lighting, Transparency, and Shading dans Help Center et File Exchange

Produits


Version

R2019a

Community Treasure Hunt

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

Start Hunting!

Translated by