MATLAB Answers

How to set the shadow in the trimesh figure?

22 views (last 30 days)
wei zhang
wei zhang on 31 Jul 2020
Edited: wei zhang on 31 Jul 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.
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.
set(gca, 'color', 'k');
lighting gouraud;
a1 = camlight('right');
a2 = camlight('left');
a3 = camlight('headlight');


Sign in to comment.

Answers (0)




Community Treasure Hunt

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

Start Hunting!