Hello! I'm trying to illuminate a patch representing a terrain, and then extract the grayscale values of the colors of each face for processing. However, I haven't yet found a way to do this. When I was working with surfaces I could use surfl and get the surface handle. However I haven't found and equivalent function for patches.
I use the following code to create and light the patch:
figure;
trisurf(Terrain.patch.faces, Terrain.patch.vertices(:,1), Terrain.patch.vertices(:,2), Terrain.patch.vertices(:,3),...
'EdgeColor', 'none', 'FaceLighting', 'gouraud', 'BackFaceLighting', 'unlit', 'FaceColor','white');
axis equal vis3d;
vs = [1;0;0];
vr = sph2cartvec(vs,Terrain.sunAzEl(1),Terrain.sunAzEl(2));
light('Position',vr);
and I get the following figure:
However when I try to get the patch handle to plot it in another figure:
handleGround = findobj(gca,'Type','patch');
figure;
trisurf(handleGround.Faces, handleGround.Vertices(:,1), handleGround.Vertices(:,2), handleGround.Vertices(:,3),handleGround.FaceVertexCData,...
'EdgeColor', 'none');
axis equal vis3d;
I cannot seem to get the new illuminted face color values. With plotting the new patch I get the following figure:
So, how do I get the patch face colors for the illuminated patch? Thanks in advance!