Is there a way of finding how much light/intensity gets projected onto a face of a patch?
I am attempting to plot a surface, then convert each surface into a patch. I am introducing a light source at a certain position. Based on the plots, the faces exposed to light change color, while the faces that are not exposed to light get shaded. I am trying to find how much light/intensity each face gets from the source.
I have tried the code below. It seems that based on the colormap of each face, each face gets light equally, which doesn't seem to be the case when looking at the plots. Is there a way of finding how much light/intensity gets projected onto each face of a patch based on the location of the lighting?
[x,y,z]= cylinder([1 1],40);
surf_info = findall(cylinder1,'Type','surface');
fv = surf2patch(surf_info.XData,surf_info.YData,surf_info.ZData,surf_info.CData);
light1=light('Position',[2 2 2],'Style','local');
color_per_face = fvcdata(fv.faces(:,1));
color_map = colormap;
color_map_2 = colormap;